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 Content-Length: 1360 Lines: 48 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/