Skip to contentSkip to conversation

check for the kzalloc return value

PATCH Applied Denis Kirjanov 2 participants 2 messages Oct 22, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check for the kzalloc return value

---
 sound/pci/als300.c |    4 ++++
 1 file changed, 4 insertions(+)
sound/pci/als300.c +4 -0
index 68c4469..e1f74d4 100644
@@ -394,6 +394,8 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream)
 	struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
 								GFP_KERNEL);
 
+	if (!data)
+		return -ENOMEM;
 	snd_als300_dbgcallenter();
 	chip->playback_substream = substream;
 	runtime->hw = snd_als300_playback_hw;
@@ -425,6 +427,8 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream)
 	struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
 								GFP_KERNEL);
 
+	if (!data)
+		return -ENOMEM;
 	snd_als300_dbgcallenter();
 	chip->capture_substream = substream;
 	runtime->hw = snd_als300_capture_hw;
Signature · 1 line
1.7.9.5
Applied
#1 lore raw

At Mon, 22 Oct 2012 17:05:53 +0400,

Quoted 3 lines · Denis Kirjanov

Thanks, applied.

Takashi

Quoted 29 lines
---
 sound/pci/als300.c |    4 ++++
 1 file changed, 4 insertions(+)
sound/pci/als300.c +4 -0
index 68c4469..e1f74d4 100644
@@ -394,6 +394,8 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream)
 	struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
 								GFP_KERNEL);
 
+	if (!data)
+		return -ENOMEM;
 	snd_als300_dbgcallenter();
 	chip->playback_substream = substream;
 	runtime->hw = snd_als300_playback_hw;
@@ -425,6 +427,8 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream)
 	struct snd_als300_substream_data *data = kzalloc(sizeof(*data),
 								GFP_KERNEL);
 
+	if (!data)
+		return -ENOMEM;
 	snd_als300_dbgcallenter();
 	chip->capture_substream = substream;
 	runtime->hw = snd_als300_capture_hw;
Signature · 1 line
1.7.9.5