diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-11-05 14:28:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-13 22:08:19 +0300 |
commit | 1e3430e27c877d6819904a310a0c82a5013b7da2 (patch) | |
tree | 13f29a0c1f33231607d74376ba65b5e9cee27802 /sound/pci/hda/thinkpad_helper.c | |
parent | e3a6b6ed37b9626abbdf304b8e6fe492b4f84f59 (diff) | |
download | linux-1e3430e27c877d6819904a310a0c82a5013b7da2.tar.xz |
ALSA: hda - Fix incorrect clearance of thinkpad_acpi hooks
commit 5e93a125f521efd00d71af31c2a301f3d46af48c upstream.
Since the commit c647f806b8c2 ("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: c647f806b8c2 ("ALSA: hda - Allow multiple ADCs for mic mute LED controls")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/hda/thinkpad_helper.c')
-rw-r--r-- | sound/pci/hda/thinkpad_helper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c index 97f49b751e6e..568575b72f2f 100644 --- a/sound/pci/hda/thinkpad_helper.c +++ b/sound/pci/hda/thinkpad_helper.c @@ -58,8 +58,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, removefunc = false; } if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0 && - snd_hda_gen_add_micmute_led(codec, - update_tpacpi_micmute) > 0) + !snd_hda_gen_add_micmute_led(codec, + update_tpacpi_micmute)) removefunc = false; } |