mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
ALSA: hda - check NULL pointer when creating SPDIF controls
If the SPDIF control array cannot be reallocated, the function will return to avoid dereferencing a NULL pointer. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9fedcc44f1
commit
25336e8ae2
@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
|
|||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
spdif = snd_array_new(&codec->spdif_out);
|
spdif = snd_array_new(&codec->spdif_out);
|
||||||
|
if (!spdif)
|
||||||
|
return -ENOMEM;
|
||||||
for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
|
for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
|
||||||
kctl = snd_ctl_new1(dig_mix, codec);
|
kctl = snd_ctl_new1(dig_mix, codec);
|
||||||
if (!kctl)
|
if (!kctl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user