Skip to content

Commit

Permalink
ALSA: update dell-wmi mic-mute registration to new world order
Browse files Browse the repository at this point in the history
Commit c647f80 ("ALSA: hda - Allow multiple ADCs for mic mute LED
controls") changed the return value of the snd_hda_gen_add_micmute_led()
without actually updating the callers.

Admittedly, almost no callers actually cared about the return value.
But one call site very much did: the Dell wmi code.  It would see the
registration return zero, which _used_ to mean "failed" but now means
"success", and clear the dell_micmute_led_set_func pointer.

End result: the successful registration would end up calling the Dell
code that thought it had all failed, and call through a NULL pointer.

To make matters worse, it ends up being a tail-call, and with the
retpoline sequence you don't even see the caller (dell_micmute_update())
in the stack trace, so the error ended up way less obvious than it
should have been.

Fixes: c647f80 "ALSA: hda - Allow multiple ADCs for mic mute LED controls"
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Aug 16, 2018
1 parent 71f3a82 commit 70b20dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/pci/hda/dell_wmi_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void alc_fixup_dell_wmi(struct hda_codec *codec,

removefunc = (dell_micmute_led_set_func(false) < 0) ||
(snd_hda_gen_add_micmute_led(codec,
dell_micmute_update) <= 0);
dell_micmute_update) < 0);
}

if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) {
Expand Down

0 comments on commit 70b20dd

Please sign in to comment.