From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Kiran Padwal <kiran.padwal@smartplayin.com>,
Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jarkko Nikula <jarkko.nikula@bitmer.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
<linux-omap@vger.kernel.org>, <alsa-devel@alsa-project.org>,
<linux-kernel@vger.kernel.org>,
Kiran Padwal <kiran.padwal21@gmail.com>,
"Sarha, Jyri" <jsarha@ti.com>
Subject: Re: [PATCH] ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
Date: Thu, 12 Feb 2015 11:22:41 +0200 [thread overview]
Message-ID: <54DC70E1.50300@ti.com> (raw)
In-Reply-To: <1423732082-23815-1-git-send-email-kiran.padwal@smartplayin.com>
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
next prev parent reply other threads:[~2015-02-12 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2015-02-14 4:33 ` 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=54DC70E1.50300@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jarkko.nikula@bitmer.com \
--cc=jsarha@ti.com \
--cc=kiran.padwal21@gmail.com \
--cc=kiran.padwal@smartplayin.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox