[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5677C7D6.3030909@ti.com>
Date: Mon, 21 Dec 2015 11:35:18 +0200
From: Peter Ujfalusi <peter.ujfalusi@...com>
To: Julia Lawall <Julia.Lawall@...6.fr>
CC: <kernel-janitors@...r.kernel.org>,
Jarkko Nikula <jarkko.nikula@...mer.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, <alsa-devel@...a-project.org>,
<linux-omap@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"Sarha, Jyri" <jsarha@...com>
Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
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/)
>
> // <smpl>
> @@
> expression x;
> identifier fld;
> @@
>
> * x = devm_kzalloc(...);
> ... when != x == NULL
> x->fld
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
Acked-by: Peter Ujfalusi <peter.ujfalusi@...com>
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists