diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-13 13:08:56 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-13 14:37:16 +0100 |
commit | 6a12afb5640217454cad21e8cf9a74b038fa3717 (patch) | |
tree | 94bc5f927ee969a3d468dd4e4d83810f60ef313d | |
parent | ALSA: hda - Add digital beep playback switch for STAC/IDT codecs (diff) | |
download | linux-6a12afb5640217454cad21e8cf9a74b038fa3717.tar.xz linux-6a12afb5640217454cad21e8cf9a74b038fa3717.zip |
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>
-rw-r--r-- | sound/pci/hda/hda_beep.c | 4 |
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"; |