lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181127123520.44940-1-wen.yang99@zte.com.cn>
Date:   Tue, 27 Nov 2018 20:35:20 +0800
From:   Wen Yang <wen.yang99@....com.cn>
To:     olivier.moysan@...com, arnaud.pouliquen@...com, broonie@...nel.org,
        tiwai@...e.com, mcoquelin.stm32@...il.com
Cc:     linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        Wen Yang <wen.yang99@....com.cn>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Julia Lawall <julia.lawall@...6.fr>,
        Wen Yang <yellowriver2010@...mail.com>,
        linux-stm32@...md-mailman.stormreply.com
Subject: [PATCH] Fix invalid use of sizeof in stm32_sai_add_mclk_provider()

sizeof(mclk) is 4 or 8 as it is the size of a pointer,
but we want to reserve space for the pointed data.
This issue was detected by using the Coccinelle software.

Signed-off-by: Wen Yang <wen.yang99@....com.cn>
CC: Olivier Moysan <olivier.moysan@...com>
CC: Arnaud Pouliquen <arnaud.pouliquen@...com>
CC: Liam Girdwood <lgirdwood@...il.com>
CC: Jaroslav Kysela <perex@...ex.cz>
CC: Takashi Iwai <tiwai@...e.com>
CC: Maxime Coquelin <mcoquelin.stm32@...il.com>
CC: Alexandre Torgue <alexandre.torgue@...com>
CC: Julia Lawall <julia.lawall@...6.fr>
CC: Wen Yang <yellowriver2010@...mail.com>
CC: linux-stm32@...md-mailman.stormreply.com
CC: linux-kernel@...r.kernel.org
---
 sound/soc/stm/stm32_sai_sub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index ea05cc91aa05..211589b0b2ef 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -390,7 +390,7 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
 	char *mclk_name, *p, *s = (char *)pname;
 	int ret, i = 0;
 
-	mclk = devm_kzalloc(dev, sizeof(mclk), GFP_KERNEL);
+	mclk = devm_kzalloc(dev, sizeof(*mclk), GFP_KERNEL);
 	if (!mclk)
 		return -ENOMEM;
 
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ