Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1832823pxb; Mon, 13 Sep 2021 06:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylxC2IItZrG86+/Z9ZlwP/X7/e1H20UZheB6PNehx3olIEplKJU/ACTA4CrUfai4aASdzR X-Received: by 2002:a92:d483:: with SMTP id p3mr4925542ilg.131.1631539989857; Mon, 13 Sep 2021 06:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539989; cv=none; d=google.com; s=arc-20160816; b=lEc8Rp4U/JBDLkVGZ4IB45sFWly/FYC8HLrJScA2BSElRgqp7FYHDtT/zWpUy1b6UJ blX9I9cqPrcKnzK8NkGnCtzAtfxihiNPVnQlGxOgAo5kjdSP0OFgqjfDEWuGiymcmFdt viaeQvnL+/Smqe9HbdFp7p2Waxad7mdpl1oW5pQlTsKiF6Gu/ftX85aUfQlX12CF4gMF GanWfi6VDYO8TKCjxr9hgNSRMfNjObOY7YGfajiKWQwQ4g+okTXG0Le5DKCD1pUqCQ+T pjLGB1qJmo5ebcMBvzL8G/7LYthaFsvQ48PtcNX7xoudD/AY3i/ZagmszRvU2IP+Mk5r siTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zU76BGIVR6Sjdyq9+/nS5uvMOaULi6osQAPcjN4/RE0=; b=p1ksid4+FGHqqlvhj07Al3DD49Z/h/IkLKrjF2nuGtwx/4qDGR9RJGFRonqG9C9Irf GgC+f8bp3MdTPEX5BLqB6P+yYoelCE5ljji01821d+XYIj/QRigTCPnXWkmEsSHMRBzW uLyNg9Z1i4ZLxlqn2kfy/qgSJ2snhXFAFjcKIIHoITV3NSdQgFq60hYE2t8kv9A0ubq0 VgjNQ/sb6J7lnIf/fVJ7pvBGAYhkcSsEF/wZqpFYtdq+gK0EBjmYHAAkclCYFGImkPux FfidFNdTRwrfRkAe7P2GH2VMKzBwLPbtiyq+ga4lzpWH2s5jMSIg9DO5JwJyqY0RMoat 2Oig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ST/bcLXo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si7185916ilc.75.2021.09.13.06.32.57; Mon, 13 Sep 2021 06:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ST/bcLXo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242186AbhIMNcn (ORCPT + 99 others); Mon, 13 Sep 2021 09:32:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:37456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241415AbhIMNYM (ORCPT ); Mon, 13 Sep 2021 09:24:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E738610D1; Mon, 13 Sep 2021 13:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539309; bh=jvto1BW8c4m+rCzIAmrjQpwTrZWMq1rifNIwG7vScDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ST/bcLXouIBpzZSUBstbNkx+xeyBT0Hb7zNGcT0f4IZ2eZMtBb9xzqnUwP8qZR/jr Tr5tqJa8o4MiI06chxCvaY1NQRTKhTte046VZaPPngVagyfN7xQVeaFx/4REfSWqfz Etsl8MKs6XEkZ4EdJLziNrxNOEwuZiRC4L4Shjas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ahmad Fatoum , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 120/144] brcmfmac: pcie: fix oops on failure to resume and reprobe Date: Mon, 13 Sep 2021 15:15:01 +0200 Message-Id: <20210913131051.937311398@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmad Fatoum [ Upstream commit d745ca4f2c4ae9f1bd8cf7d8ac6e22d739bffd19 ] When resuming from suspend, brcmf_pcie_pm_leave_D3 will first attempt a hot resume and then fall back to removing the PCI device and then reprobing. If this probe fails, the kernel will oops, because brcmf_err, which is called to report the failure will dereference the stale bus pointer. Open code and use the default bus-less brcmf_err to avoid this. Fixes: 8602e62441ab ("brcmfmac: pass bus to the __brcmf_err() in pcie.c") Signed-off-by: Ahmad Fatoum Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210817063521.22450-1-a.fatoum@pengutronix.de Signed-off-by: Sasha Levin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index bda042138e96..e6001f0a81a3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -2073,7 +2073,7 @@ cleanup: err = brcmf_pcie_probe(pdev, NULL); if (err) - brcmf_err(bus, "probe after resume failed, err=%d\n", err); + __brcmf_err(NULL, __func__, "probe after resume failed, err=%d\n", err); return err; } -- 2.30.2