summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-13 15:08:56 +0300
committerTakashi Iwai <tiwai@suse.de>2008-11-13 16:37:16 +0300
commit6a12afb5640217454cad21e8cf9a74b038fa3717 (patch)
tree94bc5f927ee969a3d468dd4e4d83810f60ef313d /sound
parent4d4e9bb339cfcde7811af10859ba1ce2fe3d46b4 (diff)
downloadlinux-6a12afb5640217454cad21e8cf9a74b038fa3717.tar.xz
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_beep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index b1796ae1e8fb..3ecd7e797dee 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -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";