ALSA: lola: add a check for the return of vmalloc()

vmalloc() is a memory allocation function which can return NULL when
some internal memory errors happen. So it is better to check the return
of it to catch the error in time.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_4221FC4089F6DF01C48F192E5784038BA205@qq.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Xiaoke Wang 2022-03-04 16:38:20 +08:00 коммит произвёл Takashi Iwai
Родитель 3cffb26fbb
Коммит d7f15befac
1 изменённых файлов: 2 добавлений и 0 удалений

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

@ -121,6 +121,8 @@ int lola_init_mixer_widget(struct lola *chip, int nid)
/* reserve memory to copy mixer data for sleep mode transitions */
chip->mixer.array_saved = vmalloc(sizeof(struct lola_mixer_array));
if (!chip->mixer.array_saved)
return -ENOMEM;
/* mixer matrix sources are physical input data and play streams */
chip->mixer.src_stream_outs = chip->pcm[PLAY].num_streams;