summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDenis Kirjanov <kirjanov@gmail.com>2012-10-22 17:05:53 +0400
committerTakashi Iwai <tiwai@suse.de>2012-10-22 16:31:40 +0200
commit21b3de881b38a84002c07b1b4bfb91892644e83f (patch)
treeffdebaf797448bb6fd33f678eba2c8e197ba2578 /sound
parentedb66893860dbc0631afc2807efdb209a03d57a2 (diff)
ALSA: als3000: check for the kzalloc return value
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/als300.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 00f157a2cf6..5af3cb6b0c1 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;