提交 68bf5700 编写于 作者: K Kulikov Vasiliy 提交者: Takashi Iwai

ALSA: riptide: check kzalloc() result

If kzalloc() fails exit with -ENOMEM.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 0b6d092c
无相关合并请求
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部