Skip to content

Commit

Permalink
ALSA: hda - Missing NULL check in hda_beep.c
Browse files Browse the repository at this point in the history
Added a NULL check of input_allocate_device() in hda_beep.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Nov 13, 2008
1 parent 4d4e9bb commit 6a12afb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/pci/hda/hda_beep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 6a12afb

Please sign in to comment.