[patch 22/59] ALSA hda-codec - Fix NULL dereference in generic hda code

Chris Wright
2007-02-03T02:53:20Z

[-- Attachment #1: alsa-hda-codec-fix-null-dereference-in-generic-hda-code.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

-stable review patch. If anyone has any objections, please let us know.
------------------

From: Takashi Iwai <tiwai@suse.de>

Fix NULL dereference in hda_generic.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
commit 6afeb11de5b28e47adea1459c35e598bb98424d6
tree 07f4dba0e2fb094b448eb9863de7b6364b768add
parent f9cc8a8b1887e6e2bb430405d0a4f9b5fb39fa5d
author Takashi Iwai <tiwai@suse.de> Mon, 18 Dec 2006 16:16:04 +0100
committer Jaroslav Kysela <perex@suse.cz> Tue, 09 Jan 2007 09:06:17 +0100

sound/pci/hda/hda_generic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-2.6.19.2.orig/sound/pci/hda/hda_generic.c
+++ linux-2.6.19.2/sound/pci/hda/hda_generic.c
@@ -485,8 +485,9 @@ static const char *get_input_type(struct
return "Front Aux";
return "Aux";
case AC_JACK_MIC_IN:
- if (node->pin_caps &
- (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT))
+ if (pinctl &&
+ (node->pin_caps &
+ (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT)))
*pinctl |= AC_PINCTL_VREF_80;
if ((location & 0x0f) == AC_JACK_LOC_FRONT)
return "Front Mic";

--