From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62458C433DF for ; Thu, 9 Jul 2020 17:19:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A4252077D for ; Thu, 9 Jul 2020 17:19:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hPjYjvRk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zJCx96ql" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A4252077D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dcmM9T+M3ODgULJne1z+pXAS1p89WGwPK10MtHxVSnE=; b=hPjYjvRkmECdjVGTxiNEenIbL QM98/7TfWDVw2z4abK+p9Fr5EMuivVedRQe2MZqMs3TgVq3CUaodWubLhNMl0dstyHms+jb1ePFrg EMJNCBgHamyru3NV2p4MI0lra8JuN+/CmnRzVKuQKHVist2sMGUiFm8c0RT3Os8pAjVvReLOE+wyc 9ir18+gCDWlrcHhDGvrdzy8UUphN5WpKK9tNhq2vyYqCFVEuYlj3qZyqBMVnnMgd9G5C4Jxdapf1e WOUMGf7VVBrUuLle9fV0yB5DK6Y3xzkmK3JTaXfzyYJ0xc3iHvGoyqucRxtgt9ZklLUKijkqtQ6qy ffU2ewT0w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtaBW-0003Hv-5Y; Thu, 09 Jul 2020 17:18:10 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtaBS-0003Gd-G5 for linux-arm-kernel@lists.infradead.org; Thu, 09 Jul 2020 17:18:07 +0000 Received: by mail-lj1-x241.google.com with SMTP id d17so3288519ljl.3 for ; Thu, 09 Jul 2020 10:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AMelQbu4GNOUTiQUXyQhTQeNmU8YQghg+buL41uO1A0=; b=zJCx96qlIkvDubrEZxfXGqWuevrvHwUjdZMs6qlAA9VKg47tSMcZVF1STIFqSLKFYC V3SuWoU2GS8m0jSjEDdHBjqQh2XrNelXA0gdTGcs/BlEl4ctO8zz+FTFW2BChI11Dpin SO9Xb3/Nfcgz3YCV/wbV/R2OdjlkioABvEKdvhu6F9j2loo1UcHJsJILy6cNPhfu+vWz NI0QrroNviR7NLP0kGXD5Qgu2kk1OLpVo4F1WuPfy5wii2kc0/1LTftx0D6SDIbvJtgZ JQlGkWOjAGsMMEX4sYiCIFsh+9i9KotYZ+gX006iIMklSVQ4d9vdSF74i/xBROTcX7L/ rCLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AMelQbu4GNOUTiQUXyQhTQeNmU8YQghg+buL41uO1A0=; b=NTKbLWwWLCqvyoo9zZ6a12491giFQEjjbWH2rMiVPS13pZFWUcDdrB+8UVgpoAkZp2 rQNrMGAf/Y6vEHIG9DgrdZeCM7i9S1UmcLU2BKkcsqvXiQ4Z7fF5nGnyneSsZA3fx5su mS+Dl5UJ/bUpZehK7BmaQWUlsXlWnsFRw5xpuRF3enYTKYUdJ2+nSu7Av4w3skC9dWYU 4viWDHLMYWr3bsHgb5RsOj0T9Dhjz+hP8pgMGlACE3qmCkVw6GdDVlhXzCFWuGC+Ha7s lEZ4o3EpqaRHGFjAoX128snfcSoeOAgHemU3rxbA+r3cbH47vjFUXCJ9f5+koAUPiyc1 aVRw== X-Gm-Message-State: AOAM5300SNmfc4DWTBBHRLdmP2CqCio+6d1iJXc6n+6ML0I1Ynt42/4Z aatP3RIS0Z58VDXDY2j/Gg7JSI7Zs1tmcRycpqMhlA== X-Google-Smtp-Source: ABdhPJy59F6ZCQSaD8uKjrbhhjFhb3xdx9OFqKmFc+CpDGYLj4EoIzWcXj907rbez1Xl3IWHWX3VNntw2kaVSl5E2p8= X-Received: by 2002:a2e:8e8d:: with SMTP id z13mr35603314ljk.215.1594315083579; Thu, 09 Jul 2020 10:18:03 -0700 (PDT) MIME-Version: 1.0 References: <20200709161002.439699-1-robh@kernel.org> In-Reply-To: <20200709161002.439699-1-robh@kernel.org> From: Anders Roxell Date: Thu, 9 Jul 2020 19:17:52 +0200 Message-ID: Subject: Re: [PATCH] PCI: host-common: Fix driver remove NULL bridge->bus dereference To: Rob Herring X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200709_131806_777287_1E62E1C8 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Lorenzo Pieralisi , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 9 Jul 2020 at 18:10, Rob Herring wrote: > > Commit 2d716c37b5ce ("PCI: host-common: Use struct > pci_host_bridge.windows list directly") moved platform_set_drvdata() > before pci_host_probe() which results in the bridge->bus pointer being > NULL. Let's change the drvdata to the bridge struct instead to fix this. > > Fixes: 2d716c37b5ce ("PCI: host-common: Use struct pci_host_bridge.windows list directly") > Reported-by: Anders Roxell > Cc: Will Deacon > Cc: Lorenzo Pieralisi > Cc: Bjorn Helgaas > Signed-off-by: Rob Herring Thank you for the quick fix. Tested-by: Anders Roxell Cheers, Anders > --- > drivers/pci/controller/pci-host-common.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c > index f8f71d99e427..b76e55f495e4 100644 > --- a/drivers/pci/controller/pci-host-common.c > +++ b/drivers/pci/controller/pci-host-common.c > @@ -83,7 +83,7 @@ int pci_host_common_probe(struct platform_device *pdev) > bridge->map_irq = of_irq_parse_and_map_pci; > bridge->swizzle_irq = pci_common_swizzle; > > - platform_set_drvdata(pdev, bridge->bus); > + platform_set_drvdata(pdev, bridge); > > return pci_host_probe(bridge); > } > @@ -91,11 +91,11 @@ EXPORT_SYMBOL_GPL(pci_host_common_probe); > > int pci_host_common_remove(struct platform_device *pdev) > { > - struct pci_bus *bus = platform_get_drvdata(pdev); > + struct pci_host_bridge *bridge = platform_get_drvdata(pdev); > > pci_lock_rescan_remove(); > - pci_stop_root_bus(bus); > - pci_remove_root_bus(bus); > + pci_stop_root_bus(bridge->bus); > + pci_remove_root_bus(bridge->bus); > pci_unlock_rescan_remove(); > > return 0; > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel