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>
This commit is contained in:
Kulikov Vasiliy 2010-07-16 20:15:59 +04:00 коммит произвёл Takashi Iwai
Родитель 0b6d092c8e
Коммит 68bf57001f
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1615,7 +1615,10 @@ static int snd_riptide_playback_open(struct snd_pcm_substream *substream)
chip->playback_substream[sub_num] = substream; chip->playback_substream[sub_num] = substream;
runtime->hw = snd_riptide_playback; runtime->hw = snd_riptide_playback;
data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
data->paths = lbus_play_paths[sub_num]; data->paths = lbus_play_paths[sub_num];
data->id = play_ids[sub_num]; data->id = play_ids[sub_num];
data->source = play_sources[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; chip->capture_substream = substream;
runtime->hw = snd_riptide_capture; runtime->hw = snd_riptide_capture;
data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
data->paths = lbus_rec_path; data->paths = lbus_rec_path;
data->id = PADC; data->id = PADC;
data->source = ACLNK2PADC; data->source = ACLNK2PADC;