Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5412453ybl; Tue, 10 Dec 2019 05:43:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxJ7v64YdYwYk+kNpEa6qC80aMpirJ1+REqoeUjgNPci7nd50B3F/FAdYEiMzKeYVFHkTw2 X-Received: by 2002:a05:6808:210:: with SMTP id l16mr4025212oie.95.1575985394930; Tue, 10 Dec 2019 05:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575985394; cv=none; d=google.com; s=arc-20160816; b=Sj/J8iAZT0z0rfSZIKluhev/+WoHLdAZlfbVYsDlYLoSwb/3x/WnRNzKWVDTtuN//P vN35EzOMA253F/nrbhkRALcG/g0HCGB+hR0veJEIGvVBJJYgGaa/u92m079kHARZYxtA sbf0/yJUx3mY/mEemZXheev6w7KAwCskUIcV0Up4JpW0kZ0s6CEsmR/OqwZ3FL+9+nWW AZJG+V5rEMr9fHN1HVxujaudo6Tv0ysIiY50AZzx/uKFgtMUC19KZnQhTaen3ahUa5VI WnLfhlAVufdQyqaAcO9f22HriPorpxDCwOQR3QjHXGpd9/BOBs9D+fojRlWFEQQpcY8s rlpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=j8XdtVdsWktRYcI+LFrFK7jSXXbF1Co8VAR3qP+1/OE=; b=ciaIWktxjGlfXcxTQF1Qe7h6GEpy59zgP/b9Bo84I/n7v/pQgSrUPWpvKGPKu+H45R DqX0UkbsaNsuHtCopiBePhq0cy28bcvHc3R4+J3t+Z7/V9ulFLjnF7TpoBuHWQK3ZGSw plw+G0oiUv1yay930Rp/S05ABcxWkQDgjUPf7J7LTKUqEQlMw65hx4SnyZ7lLpBybG57 ZC7P+ZWd17t4SkTkqCddZnwFKrdJAASJDRIst8CWzia1Edr9LLVGXfSTWbV1riTuwst7 iixONy31T+CDyUirWKSRQg18q97n1DmA78IeGuQEBTiuShniNT2b4DQ9Zo9ZJbCCnFnI 1CZg== 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 t189si1779566oie.13.2019.12.10.05.43.02; Tue, 10 Dec 2019 05:43:14 -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 S1727385AbfLJNlM (ORCPT + 99 others); Tue, 10 Dec 2019 08:41:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:41722 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727131AbfLJNlL (ORCPT ); Tue, 10 Dec 2019 08:41:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7D78AD7B; Tue, 10 Dec 2019 13:41:09 +0000 (UTC) Date: Tue, 10 Dec 2019 14:41:08 +0100 Message-ID: From: Takashi Iwai To: Lukas Wunner 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 Subject: Re: [PATCH] ALSA: hda/hdmi - Fix duplicate unref of pci_dev In-Reply-To: <77aa6c01aefe1ebc4004e87b0bc714f2759f15c4.1575985006.git.lukas@wunner.de> References: <77aa6c01aefe1ebc4004e87b0bc714f2759f15c4.1575985006.git.lukas@wunner.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Dec 2019 14:39:50 +0100, Lukas Wunner wrote: > > 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 Applied now. Thanks. Takashi > --- > 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 >