All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Takashi Iwai <tiwai@suse.com>, "Sarha, Jyri" <jsarha@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
Date: Mon, 21 Dec 2015 11:35:18 +0200	[thread overview]
Message-ID: <5677C7D6.3030909@ti.com> (raw)
In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr>

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@lip6.fr>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.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

WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Takashi Iwai <tiwai@suse.com>, "Sarha, Jyri" <jsarha@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
Date: Mon, 21 Dec 2015 09:35:18 +0000	[thread overview]
Message-ID: <5677C7D6.3030909@ti.com> (raw)
In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr>

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@lip6.fr>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.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 kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: <kernel-janitors@vger.kernel.org>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, <alsa-devel@alsa-project.org>,
	<linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Sarha, Jyri" <jsarha@ti.com>
Subject: Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
Date: Mon, 21 Dec 2015 11:35:18 +0200	[thread overview]
Message-ID: <5677C7D6.3030909@ti.com> (raw)
In-Reply-To: <1450610153-7746-3-git-send-email-Julia.Lawall@lip6.fr>

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@lip6.fr>

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.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

  reply	other threads:[~2015-12-21  9:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-20 11:15 [PATCH 0/4] add NULL test Julia Lawall
2015-12-20 11:15 ` Julia Lawall
2015-12-20 11:15 ` [PATCH 1/4] ASoC: imx-pcm-dma: " Julia Lawall
2015-12-20 11:15   ` Julia Lawall
2015-12-21  7:34   ` Nicolin Chen
2015-12-21  7:34     ` Nicolin Chen
2015-12-23  0:08   ` Applied "ASoC: imx-pcm-dma: add NULL test" to the asoc tree Mark Brown
2015-12-20 11:15 ` [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test Julia Lawall
2015-12-20 11:15   ` Julia Lawall
2015-12-21  9:35   ` Peter Ujfalusi [this message]
2015-12-21  9:35     ` Peter Ujfalusi
2015-12-21  9:35     ` Peter Ujfalusi
2015-12-23  0:08   ` Applied "ASoC: omap-hdmi-audio: add NULL test" to the asoc tree Mark Brown
2015-12-20 11:15 ` [PATCH 3/4] s390/cio: add NULL test Julia Lawall
2015-12-20 11:15   ` Julia Lawall
2015-12-21  9:33   ` Heiko Carstens
2015-12-21  9:33     ` Heiko Carstens
2015-12-20 11:15 ` [PATCH 4/4] ASoC: Intel: " Julia Lawall
2015-12-20 11:15   ` Julia Lawall
2015-12-23  0:02   ` Mark Brown
2015-12-23  6:58     ` Julia Lawall
2015-12-23  6:58       ` Julia Lawall
2015-12-23  6:58       ` Julia Lawall
2015-12-23  0:08   ` Applied "ASoC: Intel: add NULL test" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5677C7D6.3030909@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=jsarha@ti.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.