mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
ALSA: hda - Missing NULL check in hda_beep.c
Added a NULL check of input_allocate_device() in hda_beep.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4d4e9bb339
commit
6a12afb564
1 changed files with 4 additions and 0 deletions
|
@ -88,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
|
|||
snprintf(beep->phys, sizeof(beep->phys),
|
||||
"card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
|
||||
input_dev = input_allocate_device();
|
||||
if (!input_dev) {
|
||||
kfree(beep);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* setup digital beep device */
|
||||
input_dev->name = "HDA Digital PCBeep";
|
||||
|
|
Loading…
Reference in a new issue