From: Takashi Iwai Date: Thu, 13 Nov 2008 12:08:56 +0000 (+0100) Subject: ALSA: hda - Missing NULL check in hda_beep.c X-Git-Tag: v2.6.28-rc6~57^2^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6a12afb5640217454cad21e8cf9a74b038fa3717;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index b1796ae1e8f..3ecd7e797de 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";