diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-02-09 10:23:52 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-02-09 12:16:31 +0100 |
commit | 2ebab40eb74a0225d5dfba72bfae317dd948fa2d (patch) | |
tree | 7818efa9571a230974c2f83d69f51d7f88136abc /sound/pci/hda/hda_generic.c | |
parent | c44d9b1181cf34e0860c72cc8a00e0c47417aac0 (diff) | |
download | blackbird-obmc-linux-2ebab40eb74a0225d5dfba72bfae317dd948fa2d.tar.gz blackbird-obmc-linux-2ebab40eb74a0225d5dfba72bfae317dd948fa2d.zip |
ALSA: hda - Fix bad dereference of jack object
The hda_jack_tbl entries are managed by snd_array for allowing
multiple jacks. It's good per se, but the problem is that struct
hda_jack_callback keeps the hda_jack_tbl pointer. Since snd_array
doesn't preserve each pointer at resizing the array, we can't keep the
original pointer but have to deduce the pointer at each time via
snd_array_entry() instead. Actually, this resulted in the deference
to the wrong pointer on codecs that have many pins such as CS4208.
This patch replaces the pointer to the NID value as the search key.
As an unexpected good side effect, this even simplifies the code, as
only NID is needed in most cases.
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 30c8efe0f80a..7ca5b89f088a 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -4028,9 +4028,9 @@ static void pin_power_callback(struct hda_codec *codec, struct hda_jack_callback *jack, bool on) { - if (jack && jack->tbl->nid) + if (jack && jack->nid) sync_power_state_change(codec, - set_pin_power_jack(codec, jack->tbl->nid, on)); + set_pin_power_jack(codec, jack->nid, on)); } /* callback only doing power up -- called at first */ |