mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] check for the kzalloc return value
@ 2012-10-22 13:05 Denis Kirjanov
  2012-10-22 14:33 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Kirjanov @ 2012-10-22 13:05 UTC (permalink / raw)
  To: perex; +Cc: tiwai, alsa-devel, linux-kernel, kirjanov


Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
---
 sound/pci/als300.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 68c4469..e1f74d4 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -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;
-- 
1.7.9.5


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

end of thread, other threads:[~2012-10-22 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 13:05 [PATCH] check for the kzalloc return value Denis Kirjanov
2012-10-22 14:33 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®