diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-16 20:15:59 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-19 17:59:26 +0200 |
commit | 68bf57001f4995a25ca65f3711ff05b6ea25e8b6 (patch) | |
tree | 5885c4edb6ff985c51407bec1d4574c2401567ee /sound | |
parent | 0b6d092c8eeeb43893503afd2f6c1c67ceafc863 (diff) | |
download | blackbird-op-linux-68bf57001f4995a25ca65f3711ff05b6ea25e8b6.tar.gz blackbird-op-linux-68bf57001f4995a25ca65f3711ff05b6ea25e8b6.zip |
ALSA: riptide: check kzalloc() result
If kzalloc() fails exit with -ENOMEM.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/riptide/riptide.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 59d79962f236..f64fb7d988cb 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -1615,7 +1615,10 @@ static int snd_riptide_playback_open(struct snd_pcm_substream *substream) chip->playback_substream[sub_num] = substream; runtime->hw = snd_riptide_playback; + data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); + if (data == NULL) + return -ENOMEM; data->paths = lbus_play_paths[sub_num]; data->id = play_ids[sub_num]; data->source = play_sources[sub_num]; @@ -1635,7 +1638,10 @@ static int snd_riptide_capture_open(struct snd_pcm_substream *substream) chip->capture_substream = substream; runtime->hw = snd_riptide_capture; + data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); + if (data == NULL) + return -ENOMEM; data->paths = lbus_rec_path; data->id = PADC; data->source = ACLNK2PADC; |