ALSA: als3000: check for the kzalloc return value
authorDenis Kirjanov <kirjanov@gmail.com>
Mon, 22 Oct 2012 13:05:53 +0000 (17:05 +0400)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Oct 2012 14:31:40 +0000 (16:31 +0200)
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/als300.c

index 00f157a..5af3cb6 100644 (file)
@@ -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;