From: Denis Kirjanov Date: Mon, 22 Oct 2012 13:05:53 +0000 (+0400) Subject: ALSA: als3000: check for the kzalloc return value X-Git-Tag: v3.7-rc3~17^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21b3de881b38a84002c07b1b4bfb91892644e83f;p=platform%2Fkernel%2Flinux-stable.git ALSA: als3000: check for the kzalloc return value Signed-off-by: Denis Kirjanov Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 00f157a..5af3cb6 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;