Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3491191imu; Sun, 11 Nov 2018 16:17:57 -0800 (PST) X-Google-Smtp-Source: AJdET5fhMQOzc5UcWVYiKeKZKmtDx07z3cehATeMFZtKUe2aO1ToKE2+snVqBwDTNA4/uF+ppVtv X-Received: by 2002:a63:9809:: with SMTP id q9mr15589949pgd.109.1541981877834; Sun, 11 Nov 2018 16:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981877; cv=none; d=google.com; s=arc-20160816; b=Qzpkw1vbEDEo5Kn4OUo1q/mwXEm0+DitBRc9MDAcD4P/LHxOp6lB9WbfvPNw41LrLb XLkVGFEEHAG7rXFoC5bovkGXyv5oEx+r2ERoFeGBf5abMfsMbx/sb/IScTVKSvqlpCLz FoqcckSocEBzPmMvoUgI1vHVKzE2CWedd4MbHQnfAmXmms0/LDdQUnD2+yO/YAA/T7Fp +7o/V+GftZmlhTNbHx0QX0V7cOSz9nCul47b9NxfIHJbXlZBwZpNWmXOuQI/cMEGgxc1 Kv+h9JlLnecMaZJKbhTwcARKE0eeghIBa1kgvMYDLeRp52IGbW8GuXMHPQkxFinEi0jd zpQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I7tRONe1iXNIwTt8rxRS2jazhNcakvBagy7wc/BkkmA=; b=hjWen2RIvBntY0nokK6xqHZy188baJgRRcJ/RoKKFB9XnvKK/QaIv5VNIeWyzg8ORq RLwOSUnaTE9cRLbyCSEUmD++aTsJZY61KKV/Y0mWDUCi8s8xglQKS+clKg+v9tkHXlnL ZSyDEYlNaMSXOLJ1aJHFVqkiTFi9/7QtwbGgdQTYz6k6+ZSJSkXid8k+He3dYkErRoMh 1RV5PMPFX8FhpcLk69pyRA1tlpYNa94wo0orRwassonHhD2Loa9KJHDqH4jgi8FInPNe 3gw6ciaZ7G27PFYGtSWQOR5S6po3uoVQGUzBEPohbJVq5Q9FXPynaqShfjme8jU5vU+v uasw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v8ux/iyo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si7913149pgq.82.2018.11.11.16.17.42; Sun, 11 Nov 2018 16:17:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v8ux/iyo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730918AbeKLKHw (ORCPT + 99 others); Mon, 12 Nov 2018 05:07:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:59016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730038AbeKLIRB (ORCPT ); Mon, 12 Nov 2018 03:17:01 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7508F214F1; Sun, 11 Nov 2018 22:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975225; bh=qA6pBm4NyYHUcDTvLDbKP2U9OlAlFaV/b3jhzRDG2dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v8ux/iyoUCpM0FjfQcsrq++IL7ZisU9vD7KRVcXoIlSnhIfi5YzdYeQ0+GWy/zdff FFEIn4hhRXkZdlGkPc5KW8WNMBNqJRMLp65P7TUmZA1eMgxZqLB5jMBEuFSeRr203V N67txI2XBqWFrIGIZ2QN5p3XQdeRE36+0xyCORjg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.19 040/361] ALSA: hda - Fix incorrect clearance of thinkpad_acpi hooks Date: Sun, 11 Nov 2018 14:16:27 -0800 Message-Id: <20181111221625.415805586@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai 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: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/thinkpad_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/pci/hda/thinkpad_helper.c +++ b/sound/pci/hda/thinkpad_helper.c @@ -58,8 +58,8 @@ static void hda_fixup_thinkpad_acpi(stru 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; }