All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: mop500_ab8500: Add a NULL pointer check in mop500_ab8500_machine_init()
@ 2015-05-20  4:50 Rajan Vaja
  2015-05-21 11:05 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Rajan Vaja @ 2015-05-20  4:50 UTC (permalink / raw)
  To: lgirdwood; +Cc: alsa-devel, rajan.vaja, lars, tiwai, broonie

Avoid possible crash (NULL pointer dereference) by making
sure that dem_kzalloc() is successful.

Signed-off-by: Rajan Vaja <rajan.vaja@gmail.com>
---
 sound/soc/ux500/mop500_ab8500.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c
index b81a7a4c..85d810d 100644
--- a/sound/soc/ux500/mop500_ab8500.c
+++ b/sound/soc/ux500/mop500_ab8500.c
@@ -372,6 +372,10 @@ int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
 	/* Create driver private-data struct */
 	drvdata = devm_kzalloc(dev, sizeof(struct mop500_ab8500_drvdata),
 			GFP_KERNEL);
+
+	if (!drvdata)
+		return -ENOMEM;
+
 	snd_soc_card_set_drvdata(rtd->card, drvdata);
 
 	/* Setup clocks */
-- 
1.7.9.5

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

* Re: [PATCH] ASoC: mop500_ab8500: Add a NULL pointer check in mop500_ab8500_machine_init()
  2015-05-20  4:50 [PATCH] ASoC: mop500_ab8500: Add a NULL pointer check in mop500_ab8500_machine_init() Rajan Vaja
@ 2015-05-21 11:05 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-05-21 11:05 UTC (permalink / raw)
  To: Rajan Vaja; +Cc: tiwai, alsa-devel, lars, lgirdwood


[-- Attachment #1.1: Type: text/plain, Size: 179 bytes --]

On Wed, May 20, 2015 at 10:20:54AM +0530, Rajan Vaja wrote:
> Avoid possible crash (NULL pointer dereference) by making
> sure that dem_kzalloc() is successful.

Applied, thanks.

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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2015-05-21 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20  4:50 [PATCH] ASoC: mop500_ab8500: Add a NULL pointer check in mop500_ab8500_machine_init() Rajan Vaja
2015-05-21 11:05 ` 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.