lkml.org 
[lkml]   [2015]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
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


\
 
 \ /
  Last update: 2015-02-12 10:41    [W:0.063 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site