Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5411318ybl; Tue, 10 Dec 2019 05:42:06 -0800 (PST) X-Google-Smtp-Source: APXvYqx9WpQlee2leDbm89heYam5+n5aEG8GrzsveCgRfz3y8jFo1kGkiKlpXoirOxXi7LZJavAQ X-Received: by 2002:a9d:6183:: with SMTP id g3mr19557585otk.304.1575985317710; Tue, 10 Dec 2019 05:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575985317; cv=none; d=google.com; s=arc-20160816; b=nydpYauRrPgh4Ldj0/f2Au3zvq0XeyUyvbPYHcJAp6n1OBKCvDO0oI1hOPeOU01jHK YKHrJwMvF8+r6aSYH3SnHGUdACPaRCNUguYhSUcabXmHWsLOG1Qfffy4ZSl/W4ByiYfh DcTHi8t98ABw1EwNvslVV5imiDWotVagmGwv8+hbVeXlAtczI80yEDo1m5NWTbCvX+ud HBPDZiVXK3qEyaQ2EYjbSjZUEd9H3+HwBceM5hbtxbb5b2449um54kfApGdeVpMd9CU3 9cfrJ/AOjGBo55QMNVtAJ8DwNIThG3AbGibGa84HkunrdhhJKUO0rJAfrjP6dGRkgxu0 /8LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:references :in-reply-to:message-id; bh=AbAZ9wazJNto2E9AV0GTMXZ+EoEBPxn3bKea89RlRLI=; b=jfqc7sU++m4wah52dE743GD9o0hH0wRdgjwc5vV0ZTeo7hfYNCfy3M/5S3BaWhlYxS EO3CphFf65y/JNnXiRmjxwyDIPEAJEAh9UyyO/5vyFme42K3wr5rxYmcDyhHBQqHvZ1+ V4FyuaoFOEdcS5DthULTjHWFMNZYVIakOwwShWo8h91dMelXJt3E6IP279OcH/CZ3m9f FbLw0d9fuHepp2EouUxW2RZsOlZ9CVMwzw9BsiXOlJclaJBu3BeKZnHGvslH6rwLoJFM nAAMFEDQCgO7ncoxWQ2RfwfttzXmPjt5dIWQ30owz96T2Irlc+c7zbb1ykHh7jfib+QC D4bA== ARC-Authentication-Results: i=1; mx.google.com; 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 q5si1964212otn.33.2019.12.10.05.41.45; Tue, 10 Dec 2019 05:41: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; 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 S1727486AbfLJNj4 (ORCPT + 99 others); Tue, 10 Dec 2019 08:39:56 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:52393 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbfLJNj4 (ORCPT ); Tue, 10 Dec 2019 08:39:56 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout3.hostsharing.net (Postfix) with ESMTPS id CC914101E692D; Tue, 10 Dec 2019 14:39:53 +0100 (CET) Received: from localhost (pd95be530.dip0.t-ipconnect.de [217.91.229.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 545A661C7F8C; Tue, 10 Dec 2019 14:39:53 +0100 (CET) X-Mailbox-Line: From 77aa6c01aefe1ebc4004e87b0bc714f2759f15c4 Mon Sep 17 00:00:00 2001 Message-Id: <77aa6c01aefe1ebc4004e87b0bc714f2759f15c4.1575985006.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Tue, 10 Dec 2019 14:39:50 +0100 Subject: [PATCH] ALSA: hda/hdmi - Fix duplicate unref of pci_dev To: Takashi Iwai Cc: Jaroslav Kysela , Alex Deucher , Mika Westerberg , Bjorn Helgaas , Nicholas Johnson , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nicholas Johnson reports a null pointer deref as well as a refcount underflow upon hot-removal of a Thunderbolt-attached AMD eGPU. He's bisected the issue down to commit 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD"). The commit iterates over PCI devices using pci_get_class() and unreferences each device found, even though pci_get_class() subsequently unreferences the device as well. Fix it. Fixes: 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD") Link: https://lore.kernel.org/r/PSXP216MB0438BFEAA0617283A834E11580580@PSXP216MB0438.KORP216.PROD.OUTLOOK.COM/ Reported-and-tested-by: Nicholas Johnson Signed-off-by: Lukas Wunner Cc: Mika Westerberg Cc: Alexander Deucher Cc: Bjorn Helgaas --- sound/pci/hda/hda_intel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 35b4526f0d28..b856b89378ac 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1419,7 +1419,6 @@ static bool atpx_present(void) return true; } } - pci_dev_put(pdev); } return false; } -- 2.24.0