Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5421106ybl; Tue, 10 Dec 2019 05:52:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxZ8K4uA5n+l7KXUwLLzGh47njPZtL6vi6zWmZD49Gh4Md28+EB23e5wVSZUYuP3jz/Gyo3 X-Received: by 2002:aca:72cd:: with SMTP id p196mr3672267oic.99.1575985930889; Tue, 10 Dec 2019 05:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575985930; cv=none; d=google.com; s=arc-20160816; b=khOx9pKZlMRQgWADyazDKTrSSAFjJF5gBSEK/6pNUwEf7M99unAeQAyxXtjCIC/A1c tFgqDjCwkucwC22Gw4LX/jw+AE9/Q5dlAy2Iuz4hZX8gZzUzDOIgugV8JGtXOeJWclM+ xcOOie0ylVi/4/nYkIonDleHDl+4NKGmCbp3+UoGe+VTzPeJpeb6Jqeue+7tYMBVASA9 2I/xRnNCt5tjuXYEVVHMp7vgbLei7Ipjv7sfprAGkM5uG3g6eYgGYdx9vVyyB+JyX2h2 HPRbwQbxeK0VtwFWJXhjfUZMPc1Fw0oEPuQeBPVMd9XC1+s/KGniDpuk+s+8nddFp8xX dbfQ== 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=Rfcj41bWXpT2RrdZ0tsuZzZcDO7h8i9JPFiLKYyLZqY=; b=PCTrqk7wX59Nq7qKB8BCfWsLpRe4SQjQXlrynNWmE1c5lbzyvKeWmZJzCixVVyhTci geLcAaaBdxYZz+NxOOhvXQa3wlT3WQlrf+bvooaGTCMxcMpTyquh4emK2Ug+ewnflfXy VYS/GP4tyhTxI8w99Capfd+vZpvM8IN4/tED1VdpLmp9pU4GO/z/2bfjx1iTNyREnrT+ mXBAaAt9Gn1Yee0w1Rh4PUo/qjO75v9Uhx+khRN3TyDPzhWHCGgY7CoJic/RNo60VdMR 0dWPJB4oUpQnw4KFuVHBNW3g5famzqtyphEkQarTZsQ+tE3Z1PKOaD/qTQAXpHRCUFmu 2cvA== 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 n23si1921600otf.265.2019.12.10.05.51.59; Tue, 10 Dec 2019 05:52:10 -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 S1727509AbfLJNuD (ORCPT + 99 others); Tue, 10 Dec 2019 08:50:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:46134 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727007AbfLJNuC (ORCPT ); Tue, 10 Dec 2019 08:50:02 -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 DD710AD6C; Tue, 10 Dec 2019 13:50:00 +0000 (UTC) Date: Tue, 10 Dec 2019 14:50:00 +0100 Message-ID: From: Takashi Iwai To: Nicholas Johnson Cc: Lukas Wunner , Jaroslav Kysela , Alex Deucher , Mika Westerberg , Bjorn Helgaas , "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: 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:47:28 +0100, Nicholas Johnson wrote: > > On Tue, Dec 10, 2019 at 02:39:50PM +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 > > --- > > 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 > > > Extremely fast turnaround from bisect to patch. > > If you want the bugzilla.kernel.org report then I can do that ASAP, but > I feel that it is redundant now. We have now Link tag to track the ML archive, so it should suffice, I suppose. > Thank you for handling my bug report. And thank you for your quick testing. Takashi