Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1902418imu; Wed, 28 Nov 2018 17:45:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/WfjRj48y6rYbmr/i4qhzHU6Yx+fDnaEeCLtcuclHgxkwgEGYeVhBlerdTljuRjIRYgxrAq X-Received: by 2002:a63:561b:: with SMTP id k27mr35327875pgb.271.1543455940163; Wed, 28 Nov 2018 17:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543455940; cv=none; d=google.com; s=arc-20160816; b=tRh4z8rUQ6/bLxFtCUvmaPchJHf0TQZb2XPoFIRhg9TWRZPdhXox8Zz8Ptt8CSXulB WdVhPzXYbC1D85i6+962WbY/sT+U5iCr6jXuFbMfTTxDqHC/OsnOBGBTzC8GdTJnpbRu wfoJSDd2K1UN3DLHS7TN3HEp/g0FHMJGdhHiENKOxhyHSlVcUiwyEdrLY2U/EBKkqKYx 1zBorr9ArUIAKDLr/7WWX0XTu5iYvN3cl/GtfGyezu02uRAoBzLBJp+6/zwF1byyqJ5W weXkHDUm5huC97UxE3wtp9/HBnD8p2bdeMtZn1u05gBl0JqYDMRqDA2qOsuPCqMMYusT cTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WQayqX7Chg+Fi03Ngnwph08xLXJ698cixNcu5IKcXL4=; b=dlmhMLIp+cQ/SlDT6Nh9+q6z0m5LMot90ryi8sQedL8ZPjmYzk4UOpfNqHmvzZrfrK /+KXBuVTFFSIpMENVwuFGrnbv7mvqBzmZ5VMg3VvHGk/FH/GrzsyRXJQsEo0r1FMl3vO rE0kYnex9oGS4gka9unVSH71AM3sh4mx5JidCQx+9C/j1Xu9bcWJmkE30SgO2iPdB+gE 048dZlqkwWtYGuBv4EXFOHOyJPepFeIbg+jKSLyi62fHwgq47YIAnKIIlRZzY7v/nhYA OUGXWDGPccF4LcMQNYRfbQFa8ibDO+7ZmXIfYc4+MCffilz6QhzkEahChNKYoX1TsylE eocA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si424811pgd.10.2018.11.28.17.45.24; Wed, 28 Nov 2018 17:45:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbeK2MsZ (ORCPT + 99 others); Thu, 29 Nov 2018 07:48:25 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:64526 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726770AbeK2MsZ (ORCPT ); Thu, 29 Nov 2018 07:48:25 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 489BC2B9D68559A14B65; Thu, 29 Nov 2018 09:44:45 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAT1idK5072002; Thu, 29 Nov 2018 09:44:39 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from LIN-A6CB96A0603.zte.intra ([10.90.106.118]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018112909450631-13598656 ; Thu, 29 Nov 2018 09:45:06 +0800 From: Wen Yang To: olivier.moysan@st.com, arnaud.pouliquen@st.com, broonie@kernel.org, tiwai@suse.com, mcoquelin.stm32@gmail.com Cc: linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, Wen Yang , Liam Girdwood , Jaroslav Kysela , Alexandre Torgue , Julia Lawall , Wen Yang , linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v2] ASoC: stm32: sai: Fix invalid use of sizeof in stm32_sai_add_mclk_provider() Date: Thu, 29 Nov 2018 09:44:34 +0800 Message-Id: <20181129014434.51578-1-wen.yang99@zte.com.cn> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-29 09:45:06, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-29 09:44:27 Content-Transfer-Encoding: quoted-printable X-MAIL: mse01.zte.com.cn wAT1idK5072002 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. v2: use subject lines matching the style for the subsystem. Signed-off-by: Wen Yang CC: Mark Brown CC: Olivier Moysan CC: Arnaud Pouliquen CC: Liam Girdwood CC: Jaroslav Kysela CC: Takashi Iwai CC: Maxime Coquelin CC: Alexandre Torgue CC: Julia Lawall CC: Wen Yang CC: linux-stm32@st-md-mailman.stormreply.com CC: linux-kernel@vger.kernel.org --- sound/soc/stm/stm32=5Fsai=5Fsub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/stm/stm32=5Fsai=5Fsub.c b/sound/soc/stm/stm32=5Fsai= =5Fsub.c index ea05cc91aa05..211589b0b2ef 100644 --- a/sound/soc/stm/stm32=5Fsai=5Fsub.c +++ b/sound/soc/stm/stm32=5Fsai=5Fsub.c @@ -390,7 +390,7 @@ static int stm32=5Fsai=5Fadd=5Fmclk=5Fprovider(struct s= tm32=5Fsai=5Fsub=5Fdata *sai) char *mclk=5Fname, *p, *s =3D (char *)pname; int ret, i =3D 0; =20 - mclk =3D devm=5Fkzalloc(dev, sizeof(mclk), GFP=5FKERNEL); + mclk =3D devm=5Fkzalloc(dev, sizeof(*mclk), GFP=5FKERNEL); if (!mclk) return -ENOMEM; =20 --=20 2.19.1