]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.drivers/alsa-hda-beep-null-check-fix
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / alsa-hda-beep-null-check-fix
1 From: Takashi Iwai <tiwai@suse.de>
2 Subject: ALSA: hda - Missing NULL check in hda_beep.c
3 Patch-mainline:
4 References:
5
6 Added a NULL check of input_allocate_device() in hda_beep.c.
7
8 Signed-off-by: Takashi Iwai <tiwai@suse.de>
9
10 ---
11 sound/pci/hda/hda_beep.c | 4 ++++
12 1 files changed, 4 insertions(+), 0 deletions(-)
13
14 diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
15 index b1796ae..3ecd7e7 100644
16 --- a/sound/pci/hda/hda_beep.c
17 +++ b/sound/pci/hda/hda_beep.c
18 @@ -88,6 +88,10 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
19 snprintf(beep->phys, sizeof(beep->phys),
20 "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr);
21 input_dev = input_allocate_device();
22 + if (!input_dev) {
23 + kfree(beep);
24 + return -ENOMEM;
25 + }
26
27 /* setup digital beep device */
28 input_dev->name = "HDA Digital PCBeep";
29 --
30 1.6.0.4
31