ALSA: hda - check NULL pointer when creating SPDIF controls
PATCH 1/1 ALSA: hda - check NULL pointer when creating SPDIF controls
From: Mengdong Lin <[email protected]>
If the SPDIF control array cannot be reallocated, the function will return to avoid dereferencing a NULL pointer.
Signed-off-by Mengdong Lin <[email protected]>
sound/pci/hda/hda_codec.c +2 -0
@@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,return -EBUSY ; } spdif =snd_array_new (&codec->spdif_out); +if (!spdif) +return -ENOMEM ;for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { kctl =snd_ctl_new1 (dig_mix, codec);if (!kctl)
Signature · 1 line
1.7.10.4
Takashi Iwai
AppliedAt Thu, 7 Mar 2013 14:10:25 -0500,
Quoted 7 lines · [email protected] wrote:
From: Mengdong Lin <[email protected]>
If the SPDIF control array cannot be reallocated, the function will return to avoid dereferencing a NULL pointer.
Signed-off-by Mengdong Lin <[email protected]>
Thanks, applied.
Takashi
Quoted 17 lines
sound/pci/hda/hda_codec.c +2
-0@@ -3334,6 +3334,8 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,return -EBUSY ; } spdif =snd_array_new (&codec->spdif_out); +if (!spdif) +return -ENOMEM ;for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) { kctl =snd_ctl_new1 (dig_mix, codec);if (!kctl)Signature · 1 line
1.7.10.4