Commit 6a12afb5 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Missing NULL check in hda_beep.c

Added a NULL check of input_allocate_device() in hda_beep.c.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4d4e9bb3
...@@ -88,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -88,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
snprintf(beep->phys, sizeof(beep->phys), snprintf(beep->phys, sizeof(beep->phys),
"card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!input_dev) {
kfree(beep);
return -ENOMEM;
}
/* setup digital beep device */ /* setup digital beep device */
input_dev->name = "HDA Digital PCBeep"; input_dev->name = "HDA Digital PCBeep";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment