Skip to content

Commit

Permalink
ALSA: als3000: check for the kzalloc return value
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
kda88 authored and tiwai committed Oct 22, 2012
1 parent edb6689 commit 21b3de8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 21b3de8

Please sign in to comment.