* [PATCH 0/4] add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: linux-s390
Cc: kernel-janitors, linuxppc-dev, alsa-devel, linux-kernel, linux-omap
Add NULL tests on various calls to kzalloc and devm_kzalloc.
The semantic match that finds these problems is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x,y;
identifier fld;
@@
(
x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...,<+... __GFP_NOFAIL ...+>,...);
|
* x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...);
)
... when != (x) == NULL
when != (x) != NULL
when != (x) == 0
when != (x) != 0
when != x = y
(
x->fld
|
*x
|
x[...]
)
// </smpl>
---
drivers/s390/char/con3215.c | 2 ++
drivers/s390/char/raw3270.c | 2 ++
sound/soc/fsl/imx-pcm-dma.c | 2 ++
sound/soc/intel/baytrail/sst-baytrail-pcm.c | 2 ++
sound/soc/omap/omap-hdmi-audio.c | 2 ++
5 files changed, 10 insertions(+)
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 0/4] add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: linux-s390
Cc: kernel-janitors, linuxppc-dev, alsa-devel, linux-kernel, linux-omap
Add NULL tests on various calls to kzalloc and devm_kzalloc.
The semantic match that finds these problems is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x,y;
identifier fld;
@@
(
x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...,<+... __GFP_NOFAIL ...+>,...);
|
* x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\|
kmemdup\|kstrdup\|
devm_kzalloc\|devm_kmalloc\|devm_kcalloc\|devm_kasprintf\|
kmalloc_array\)(...);
)
... when != (x) = NULL
when != (x) != NULL
when != (x) = 0
when != (x) != 0
when != x = y
(
x->fld
|
*x
|
x[...]
)
// </smpl>
---
drivers/s390/char/con3215.c | 2 ++
drivers/s390/char/raw3270.c | 2 ++
sound/soc/fsl/imx-pcm-dma.c | 2 ++
sound/soc/intel/baytrail/sst-baytrail-pcm.c | 2 ++
sound/soc/omap/omap-hdmi-audio.c | 2 ++
5 files changed, 10 insertions(+)
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 1/4] ASoC: imx-pcm-dma: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-20 11:15 ` Julia Lawall
-1 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Timur Tabi
Cc: kernel-janitors, Nicolin Chen, Xiubo Li, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel,
linuxppc-dev, linux-kernel
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;
@@
* x = devm_kzalloc(...);
... when != x == NULL
*x
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
sound/soc/fsl/imx-pcm-dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 1fc01ed..f3d3d1f 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
config = devm_kzalloc(&pdev->dev,
sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
+ if (!config)
+ return -ENOMEM;
*config = imx_dmaengine_pcm_config;
if (size)
config->prealloc_buffer_size = size;
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 1/4] ASoC: imx-pcm-dma: add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Timur Tabi
Cc: kernel-janitors, Nicolin Chen, Xiubo Li, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel,
linuxppc-dev, linux-kernel
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;
@@
* x = devm_kzalloc(...);
... when != x = NULL
*x
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
sound/soc/fsl/imx-pcm-dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 1fc01ed..f3d3d1f 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
config = devm_kzalloc(&pdev->dev,
sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
+ if (!config)
+ return -ENOMEM;
*config = imx_dmaengine_pcm_config;
if (size)
config->prealloc_buffer_size = size;
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-20 11:15 ` Julia Lawall
-1 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: kernel-janitors, Jarkko Nikula, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-omap,
linux-kernel
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/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);
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: kernel-janitors, Jarkko Nikula, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-omap,
linux-kernel
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/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);
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 3/4] s390/cio: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-20 11:15 ` Julia Lawall
-1 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Martin Schwidefsky
Cc: kernel-janitors, Heiko Carstens, linux-s390, linux-kernel
Add NULL test on call to kzalloc.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x;
identifier fld;
@@
* x = kzalloc(...);
... when != x == NULL
x->fld
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/s390/char/con3215.c | 2 ++
1 files changed, 2 insertions(+)
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 0fc3fe5..7d82bbc 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -922,6 +922,8 @@ static int __init con3215_init(void)
spin_lock_init(&raw3215_freelist_lock);
for (i = 0; i < NR_3215_REQ; i++) {
req = kzalloc(sizeof(struct raw3215_req), GFP_KERNEL | GFP_DMA);
+ if (!req)
+ return -ENOMEM;
req->next = raw3215_freelist;
raw3215_freelist = req;
}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 3/4] s390/cio: add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Martin Schwidefsky
Cc: kernel-janitors, Heiko Carstens, linux-s390, linux-kernel
Add NULL test on call to kzalloc.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x;
identifier fld;
@@
* x = kzalloc(...);
... when != x = NULL
x->fld
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/s390/char/con3215.c | 2 ++
1 files changed, 2 insertions(+)
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 0fc3fe5..7d82bbc 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -922,6 +922,8 @@ static int __init con3215_init(void)
spin_lock_init(&raw3215_freelist_lock);
for (i = 0; i < NR_3215_REQ; i++) {
req = kzalloc(sizeof(struct raw3215_req), GFP_KERNEL | GFP_DMA);
+ if (!req)
+ return -ENOMEM;
req->next = raw3215_freelist;
raw3215_freelist = req;
}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 4/4] ASoC: Intel: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-20 11:15 ` Julia Lawall
-1 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Liam Girdwood
Cc: kernel-janitors, Mark Brown, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linux-kernel
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);
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 4/4] ASoC: Intel: add NULL test
@ 2015-12-20 11:15 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-20 11:15 UTC (permalink / raw)
To: Liam Girdwood
Cc: kernel-janitors, Mark Brown, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linux-kernel
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);
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 1/4] ASoC: imx-pcm-dma: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-21 7:34 ` Nicolin Chen
-1 siblings, 0 replies; 24+ messages in thread
From: Nicolin Chen @ 2015-12-21 7:34 UTC (permalink / raw)
To: Julia Lawall
Cc: Timur Tabi, kernel-janitors, Xiubo Li, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
linux-kernel
On Sun, Dec 20, 2015 at 12:15:50PM +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/)
>
> // <smpl>
> @@
> expression x;
> @@
>
> * x = devm_kzalloc(...);
> ... when != x == NULL
> *x
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Thank you
>
> ---
> sound/soc/fsl/imx-pcm-dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
> index 1fc01ed..f3d3d1f 100644
> --- a/sound/soc/fsl/imx-pcm-dma.c
> +++ b/sound/soc/fsl/imx-pcm-dma.c
> @@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
>
> config = devm_kzalloc(&pdev->dev,
> sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
> + if (!config)
> + return -ENOMEM;
> *config = imx_dmaengine_pcm_config;
> if (size)
> config->prealloc_buffer_size = size;
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/4] ASoC: imx-pcm-dma: add NULL test
@ 2015-12-21 7:34 ` Nicolin Chen
0 siblings, 0 replies; 24+ messages in thread
From: Nicolin Chen @ 2015-12-21 7:34 UTC (permalink / raw)
To: Julia Lawall
Cc: Timur Tabi, kernel-janitors, Xiubo Li, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
linux-kernel
On Sun, Dec 20, 2015 at 12:15:50PM +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/)
>
> // <smpl>
> @@
> expression x;
> @@
>
> * x = devm_kzalloc(...);
> ... when != x = NULL
> *x
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Thank you
>
> ---
> sound/soc/fsl/imx-pcm-dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
> index 1fc01ed..f3d3d1f 100644
> --- a/sound/soc/fsl/imx-pcm-dma.c
> +++ b/sound/soc/fsl/imx-pcm-dma.c
> @@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
>
> config = devm_kzalloc(&pdev->dev,
> sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
> + if (!config)
> + return -ENOMEM;
> *config = imx_dmaengine_pcm_config;
> if (size)
> config->prealloc_buffer_size = size;
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 3/4] s390/cio: add NULL test
2015-12-20 11:15 ` Julia Lawall
@ 2015-12-21 9:33 ` Heiko Carstens
-1 siblings, 0 replies; 24+ messages in thread
From: Heiko Carstens @ 2015-12-21 9:33 UTC (permalink / raw)
To: Julia Lawall
Cc: Martin Schwidefsky, kernel-janitors, linux-s390, linux-kernel
On Sun, Dec 20, 2015 at 12:15:52PM +0100, Julia Lawall wrote:
> Add NULL test on call to kzalloc.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression x;
> identifier fld;
> @@
>
> * x = kzalloc(...);
> ... when != x == NULL
> x->fld
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Aplied, thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 3/4] s390/cio: add NULL test
@ 2015-12-21 9:33 ` Heiko Carstens
0 siblings, 0 replies; 24+ messages in thread
From: Heiko Carstens @ 2015-12-21 9:33 UTC (permalink / raw)
To: Julia Lawall
Cc: Martin Schwidefsky, kernel-janitors, linux-s390, linux-kernel
On Sun, Dec 20, 2015 at 12:15:52PM +0100, Julia Lawall wrote:
> Add NULL test on call to kzalloc.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression x;
> identifier fld;
> @@
>
> * x = kzalloc(...);
> ... when != x = NULL
> x->fld
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Aplied, thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
2015-12-20 11:15 ` Julia Lawall
(?)
@ 2015-12-21 9:35 ` Peter Ujfalusi
-1 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2015-12-21 9:35 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, Jarkko Nikula, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-omap,
linux-kernel, Sarha, Jyri
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
@ 2015-12-21 9:35 ` Peter Ujfalusi
0 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2015-12-21 9:35 UTC (permalink / raw)
To: Julia Lawall
Cc: alsa-devel, linux-omap, linux-kernel, kernel-janitors,
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.
>
> 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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/4] ASoC: omap-hdmi-audio: add NULL test
@ 2015-12-21 9:35 ` Peter Ujfalusi
0 siblings, 0 replies; 24+ messages in thread
From: Peter Ujfalusi @ 2015-12-21 9:35 UTC (permalink / raw)
To: Julia Lawall
Cc: alsa-devel, linux-omap, linux-kernel, kernel-janitors,
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.
>
> 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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/4] ASoC: Intel: add NULL test
2015-12-20 11:15 ` Julia Lawall
(?)
@ 2015-12-23 0:02 ` Mark Brown
2015-12-23 6:58 ` Julia Lawall
-1 siblings, 1 reply; 24+ messages in thread
From: Mark Brown @ 2015-12-23 0:02 UTC (permalink / raw)
To: Julia Lawall
Cc: Liam Girdwood, kernel-janitors, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Applied "ASoC: Intel: add NULL test" to the asoc tree
2015-12-20 11:15 ` Julia Lawall
(?)
(?)
@ 2015-12-23 0:08 ` Mark Brown
-1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2015-12-23 0:08 UTC (permalink / raw)
To: Julia Lawall, Mark Brown; +Cc: alsa-devel
The patch
ASoC: Intel: add NULL test
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 3f317c9faabc546a503bc62e806fa2e8e93e76be Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 20 Dec 2015 12:15:53 +0100
Subject: [PATCH] ASoC: Intel: add NULL test
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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 79547bec558b..4765ad474544 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);
--
2.6.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Applied "ASoC: omap-hdmi-audio: add NULL test" to the asoc tree
2015-12-20 11:15 ` Julia Lawall
(?)
(?)
@ 2015-12-23 0:08 ` Mark Brown
-1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2015-12-23 0:08 UTC (permalink / raw)
To: Julia Lawall, Peter Ujfalusi, Mark Brown; +Cc: alsa-devel
The patch
ASoC: omap-hdmi-audio: add NULL test
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 18c94a043d6a466938f13761081a5cbee802dad1 Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 20 Dec 2015 12:15:51 +0100
Subject: [PATCH] ASoC: omap-hdmi-audio: add NULL test
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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 584b2372339e..f83cc2bc0fc4 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);
--
2.6.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Applied "ASoC: imx-pcm-dma: add NULL test" to the asoc tree
2015-12-20 11:15 ` Julia Lawall
(?)
(?)
@ 2015-12-23 0:08 ` Mark Brown
-1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2015-12-23 0:08 UTC (permalink / raw)
To: Julia Lawall, Nicolin Chen, Mark Brown; +Cc: alsa-devel
The patch
ASoC: imx-pcm-dma: add NULL test
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 10974ccf04b096fd79ad90fd50276b79c069f2cc Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 20 Dec 2015 12:15:50 +0100
Subject: [PATCH] ASoC: imx-pcm-dma: add NULL test
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;
@@
* x = devm_kzalloc(...);
... when != x == NULL
*x
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/fsl/imx-pcm-dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 1fc01ed3279d..f3d3d1ffa84e 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
config = devm_kzalloc(&pdev->dev,
sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
+ if (!config)
+ return -ENOMEM;
*config = imx_dmaengine_pcm_config;
if (size)
config->prealloc_buffer_size = size;
--
2.6.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 4/4] ASoC: Intel: add NULL test
2015-12-23 0:02 ` Mark Brown
2015-12-23 6:58 ` Julia Lawall
@ 2015-12-23 6:58 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-23 6:58 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, kernel-janitors, Jaroslav Kysela, Takashi Iwai,
alsa-devel, linux-kernel
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/4] ASoC: Intel: add NULL test
@ 2015-12-23 6:58 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-23 6:58 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, Liam Girdwood, kernel-janitors, linux-kernel, Takashi Iwai
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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/4] ASoC: Intel: add NULL test
@ 2015-12-23 6:58 ` Julia Lawall
0 siblings, 0 replies; 24+ messages in thread
From: Julia Lawall @ 2015-12-23 6:58 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, Liam Girdwood, kernel-janitors, linux-kernel, Takashi Iwai
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
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2015-12-23 6:58 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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.