All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
  2015-03-03 13:18   ` Lars-Peter Clausen
@ 2015-03-03 13:41 ` Vishal Thanki
  -1 siblings, 0 replies; 14+ messages in thread
From: Vishal Thanki @ 2015-03-03 13:29 UTC (permalink / raw)
  To: kernel-janitors, alsa-devel, broonie, lgirdwood

Make sure devm_kzalloc() succeeds.

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
---
 sound/soc/generic/simple-card.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index f7c6734..fb550b5 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
 			    strlen(dai_link->cpu_dai_name)   +
 			    strlen(dai_link->codec_dai_name) + 2,
 			    GFP_KERNEL);
+	if (!name) {
+		ret = -ENOMEM;
+		goto dai_link_of_err;
+	}
+
 	sprintf(name, "%s-%s", dai_link->cpu_dai_name,
 				dai_link->codec_dai_name);
 	dai_link->name = dai_link->stream_name = name;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
@ 2015-03-03 13:14 Vishal Thanki
  2015-03-03 13:18   ` Lars-Peter Clausen
  0 siblings, 1 reply; 14+ messages in thread
From: Vishal Thanki @ 2015-03-03 13:14 UTC (permalink / raw)
  To: kernel-janitors, alsa-devel, broonie, lgirdwood

Make sure devm_kzalloc() succeeds.

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>

diff --git a/sound/soc/generic/simple-card.c
b/sound/soc/generic/simple-card.c
index f7c6734..fb550b5 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct
device_node *node,
     strlen(dai_link->cpu_dai_name)   +
     strlen(dai_link->codec_dai_name) + 2,
     GFP_KERNEL);
+ if (!name) {
+ ret = -ENOMEM;
+ goto dai_link_of_err;
+ }
+
  sprintf(name, "%s-%s", dai_link->cpu_dai_name,
  dai_link->codec_dai_name);
  dai_link->name = dai_link->stream_name = name;
--

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

end of thread, other threads:[~2015-03-05 19:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03 13:29 [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of Vishal Thanki
2015-03-03 13:41 ` Vishal Thanki
2015-03-03 14:25 ` Mark Brown
2015-03-03 14:25   ` Mark Brown
2015-03-04 20:29 ` walter harms
2015-03-04 20:29   ` walter harms
2015-03-05 10:45   ` Vishal Thanki
2015-03-05 12:03     ` [alsa-devel] " Lars-Peter Clausen
2015-03-05 12:03       ` Lars-Peter Clausen
2015-03-05 19:35       ` walter harms
2015-03-05 19:35         ` walter harms
  -- strict thread matches above, loose matches on Subject: below --
2015-03-03 13:14 Vishal Thanki
2015-03-03 13:18 ` [alsa-devel] " Lars-Peter Clausen
2015-03-03 13:18   ` Lars-Peter Clausen

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.