From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test Date: Mon, 21 Dec 2015 11:35:18 +0200 Message-ID: <5677C7D6.3030909@ti.com> References: <1450610153-7746-1-git-send-email-Julia.Lawall@lip6.fr> <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by alsa0.perex.cz (Postfix) with ESMTP id 94896261ACA for ; Mon, 21 Dec 2015 10:35:24 +0100 (CET) In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Julia Lawall Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Takashi Iwai , "Sarha, Jyri" , Liam Girdwood , Mark Brown , Jarkko Nikula List-Id: alsa-devel@alsa-project.org On 12/20/2015 01:15 PM, Julia Lawall wrote: > Add NULL test on call to devm_kzalloc. > = > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > = > // > @@ > expression x; > identifier fld; > @@ > = > * x =3D devm_kzalloc(...); > ... when !=3D x =3D=3D NULL > x->fld > // > = > Signed-off-by: Julia Lawall Acked-by: Peter Ujfalusi > --- > sound/soc/omap/omap-hdmi-audio.c | 2 ++ > 1 file changed, 2 insertions(+) > = > diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-= audio.c > index 584b237..f83cc2b 100644 > --- a/sound/soc/omap/omap-hdmi-audio.c > +++ b/sound/soc/omap/omap-hdmi-audio.c > @@ -368,6 +368,8 @@ static int omap_hdmi_audio_probe(struct platform_devi= ce *pdev) > card->owner =3D THIS_MODULE; > card->dai_link =3D > devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL); > + if (!card->dai_link) > + return -ENOMEM; > card->dai_link->name =3D card->name; > card->dai_link->stream_name =3D card->name; > card->dai_link->cpu_dai_name =3D dev_name(ad->dssdev); > = -- = P=E9ter From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Date: Mon, 21 Dec 2015 09:35:18 +0000 Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test Message-Id: <5677C7D6.3030909@ti.com> List-Id: References: <1450610153-7746-1-git-send-email-Julia.Lawall@lip6.fr> <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Julia Lawall Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Takashi Iwai , "Sarha, Jyri" , Liam Girdwood , Mark Brown , Jarkko Nikula On 12/20/2015 01:15 PM, Julia Lawall wrote: > Add NULL test on call to devm_kzalloc. >=20 > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) >=20 > // > @@ > expression x; > identifier fld; > @@ >=20 > * x =3D devm_kzalloc(...); > ... when !=3D x =3D NULL > x->fld > // >=20 > Signed-off-by: Julia Lawall Acked-by: Peter Ujfalusi > --- > sound/soc/omap/omap-hdmi-audio.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-= audio.c > index 584b237..f83cc2b 100644 > --- a/sound/soc/omap/omap-hdmi-audio.c > +++ b/sound/soc/omap/omap-hdmi-audio.c > @@ -368,6 +368,8 @@ static int omap_hdmi_audio_probe(struct platform_devi= ce *pdev) > card->owner =3D THIS_MODULE; > card->dai_link > devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KE= RNEL); > + if (!card->dai_link) > + return -ENOMEM; > card->dai_link->name =3D card->name; > card->dai_link->stream_name =3D card->name; > card->dai_link->cpu_dai_name =3D dev_name(ad->dssdev); >=20 --=20 P=E9ter -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751531AbbLUJfq (ORCPT ); Mon, 21 Dec 2015 04:35:46 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:43246 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbbLUJfo (ORCPT ); Mon, 21 Dec 2015 04:35:44 -0500 Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test To: Julia Lawall References: <1450610153-7746-1-git-send-email-Julia.Lawall@lip6.fr> <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> CC: , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , , , , "Sarha, Jyri" From: Peter Ujfalusi Message-ID: <5677C7D6.3030909@ti.com> Date: Mon, 21 Dec 2015 11:35:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/20/2015 01:15 PM, Julia Lawall wrote: > Add NULL test on call to devm_kzalloc. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > expression x; > identifier fld; > @@ > > * x = devm_kzalloc(...); > ... when != x == NULL > x->fld > // > > Signed-off-by: Julia Lawall Acked-by: Peter Ujfalusi > --- > sound/soc/omap/omap-hdmi-audio.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c > index 584b237..f83cc2b 100644 > --- a/sound/soc/omap/omap-hdmi-audio.c > +++ b/sound/soc/omap/omap-hdmi-audio.c > @@ -368,6 +368,8 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev) > card->owner = THIS_MODULE; > card->dai_link = > devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL); > + if (!card->dai_link) > + return -ENOMEM; > card->dai_link->name = card->name; > card->dai_link->stream_name = card->name; > card->dai_link->cpu_dai_name = dev_name(ad->dssdev); > -- Péter