]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/alsa-hda-beep-null-check-fix
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / alsa-hda-beep-null-check-fix
CommitLineData
2cb7cef9
BS
1From: Takashi Iwai <tiwai@suse.de>
2Subject: ALSA: hda - Missing NULL check in hda_beep.c
3Patch-mainline:
4References:
5
6Added a NULL check of input_allocate_device() in hda_beep.c.
7
8Signed-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
14diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
15index 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--
301.6.0.4
31