All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
@ 2015-02-12  9:08 Kiran Padwal
  2015-02-12  9:22   ` Peter Ujfalusi
  2015-02-14  4:33 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Kiran Padwal @ 2015-02-12  9:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jarkko Nikula, Peter Ujfalusi, Jaroslav Kysela,
	Takashi Iwai, linux-omap, alsa-devel, linux-kernel, Kiran Padwal,
	Kiran Padwal

This patch add a missing check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.

Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
---
 sound/soc/omap/omap-hdmi-audio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index ccfb41c..f7eb42a 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -352,6 +352,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
 		return ret;
 
 	card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
+	if (!card)
+		return -ENOMEM;
+
 	card->name = devm_kasprintf(dev, GFP_KERNEL,
 				    "HDMI %s", dev_name(ad->dssdev));
 	card->owner = THIS_MODULE;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
  2015-02-12  9:08 [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc Kiran Padwal
@ 2015-02-12  9:22   ` Peter Ujfalusi
  2015-02-14  4:33 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2015-02-12  9:22 UTC (permalink / raw)
  To: Kiran Padwal, Mark Brown
  Cc: alsa-devel, Takashi Iwai, linux-kernel, Liam Girdwood,
	Sarha, Jyri, Kiran Padwal, linux-omap, Jarkko Nikula

On 02/12/2015 11:08 AM, Kiran Padwal wrote:
> This patch add a missing check on the return value of devm_kzalloc,
> which would cause a NULL pointer dereference in a OOM situation.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
> ---
>  sound/soc/omap/omap-hdmi-audio.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
> index ccfb41c..f7eb42a 100644
> --- a/sound/soc/omap/omap-hdmi-audio.c
> +++ b/sound/soc/omap/omap-hdmi-audio.c
> @@ -352,6 +352,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
> +	if (!card)
> +		return -ENOMEM;
> +
>  	card->name = devm_kasprintf(dev, GFP_KERNEL,
>  				    "HDMI %s", dev_name(ad->dssdev));
>  	card->owner = THIS_MODULE;
> 


-- 
Péter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
@ 2015-02-12  9:22   ` Peter Ujfalusi
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2015-02-12  9:22 UTC (permalink / raw)
  To: Kiran Padwal, Mark Brown
  Cc: Liam Girdwood, Jarkko Nikula, Jaroslav Kysela, Takashi Iwai,
	linux-omap, alsa-devel, linux-kernel, Kiran Padwal, Sarha, Jyri

On 02/12/2015 11:08 AM, Kiran Padwal wrote:
> This patch add a missing check on the return value of devm_kzalloc,
> which would cause a NULL pointer dereference in a OOM situation.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
> ---
>  sound/soc/omap/omap-hdmi-audio.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
> index ccfb41c..f7eb42a 100644
> --- a/sound/soc/omap/omap-hdmi-audio.c
> +++ b/sound/soc/omap/omap-hdmi-audio.c
> @@ -352,6 +352,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
> +	if (!card)
> +		return -ENOMEM;
> +
>  	card->name = devm_kasprintf(dev, GFP_KERNEL,
>  				    "HDMI %s", dev_name(ad->dssdev));
>  	card->owner = THIS_MODULE;
> 


-- 
Péter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
  2015-02-12  9:08 [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc Kiran Padwal
  2015-02-12  9:22   ` Peter Ujfalusi
@ 2015-02-14  4:33 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-02-14  4:33 UTC (permalink / raw)
  To: Kiran Padwal
  Cc: Liam Girdwood, Jarkko Nikula, Peter Ujfalusi, Jaroslav Kysela,
	Takashi Iwai, linux-omap, alsa-devel, linux-kernel, Kiran Padwal

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

On Thu, Feb 12, 2015 at 02:38:02PM +0530, Kiran Padwal wrote:
> This patch add a missing check on the return value of devm_kzalloc,
> which would cause a NULL pointer dereference in a OOM situation.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-14  4:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12  9:08 [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc Kiran Padwal
2015-02-12  9:22 ` Peter Ujfalusi
2015-02-12  9:22   ` Peter Ujfalusi
2015-02-14  4:33 ` 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.