Skip to content

Commit 5e93a12

Browse files
committed
ALSA: hda - Fix incorrect clearance of thinkpad_acpi hooks
Since the commit c647f80 ("ALSA: hda - Allow multiple ADCs for mic mute LED controls") we allow enabling the mic mute LED with multiple ADCs. The commit changed the function return value to be zero or a negative error, while this change was overlooked in the thinkpad_acpi helper code where it still expects a positive return value for success. This eventually leads to a NULL dereference on a system that has only a mic mute LED. This patch corrects the return value check in the corresponding code as well. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201621 Fixes: c647f80 ("ALSA: hda - Allow multiple ADCs for mic mute LED controls") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent fc09ab7 commit 5e93a12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/pci/hda/thinkpad_helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
5858
removefunc = false;
5959
}
6060
if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0 &&
61-
snd_hda_gen_add_micmute_led(codec,
62-
update_tpacpi_micmute) > 0)
61+
!snd_hda_gen_add_micmute_led(codec,
62+
update_tpacpi_micmute))
6363
removefunc = false;
6464
}
6565

0 commit comments

Comments
 (0)