Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295562 > unrolled thread

[PATCH 4/4] ASoC: Intel: add NULL test

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2015-12-20 12:30 +0100
Last post2015-12-23 08:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/4] ASoC: Intel: add NULL test Julia Lawall <Julia.Lawall@lip6.fr> - 2015-12-20 12:30 +0100
    Re: [PATCH 4/4] ASoC: Intel: add NULL test Mark Brown <broonie@kernel.org> - 2015-12-23 01:10 +0100
      Re: [PATCH 4/4] ASoC: Intel: add NULL test Julia Lawall <julia.lawall@lip6.fr> - 2015-12-23 08:00 +0100

#1295562 — [PATCH 4/4] ASoC: Intel: add NULL test

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2015-12-20 12:30 +0100
Subject[PATCH 4/4] ASoC: Intel: add NULL test
Message-ID<qHKlA-8mk-1@gated-at.bofh.it>
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>

---
 sound/soc/intel/baytrail/sst-baytrail-pcm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/intel/baytrail/sst-baytrail-pcm.c b/sound/soc/intel/baytrail/sst-baytrail-pcm.c
index 79547be..4765ad4 100644
--- a/sound/soc/intel/baytrail/sst-baytrail-pcm.c
+++ b/sound/soc/intel/baytrail/sst-baytrail-pcm.c
@@ -377,6 +377,8 @@ static int sst_byt_pcm_probe(struct snd_soc_platform *platform)
 
 	priv_data = devm_kzalloc(platform->dev, sizeof(*priv_data),
 				 GFP_KERNEL);
+	if (!priv_data)
+		return -ENOMEM;
 	priv_data->byt = plat_data->dsp;
 	snd_soc_platform_set_drvdata(platform, priv_data);
 

--
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/

[toc] | [next] | [standalone]


#1297157

FromMark Brown <broonie@kernel.org>
Date2015-12-23 01:10 +0100
Message-ID<qIFa9-2sG-11@gated-at.bofh.it>
In reply to#1295562

[Multipart message — attachments visible in raw view] — view raw

On Sun, Dec 20, 2015 at 12:15:53PM +0100, 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/)

If there was a patch 3 in this series I seem to be missing it.

[toc] | [prev] | [next] | [standalone]


#1297267

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-12-23 08:00 +0100
Message-ID<qILyW-6cO-11@gated-at.bofh.it>
In reply to#1297157

On Wed, 23 Dec 2015, Mark Brown wrote:

> On Sun, Dec 20, 2015 at 12:15:53PM +0100, 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/)
> 
> If there was a patch 3 in this series I seem to be missing it.

It's not for you (drivers/s390/char/con3215.c).  Sorry for the confusion.

julia
--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web