Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp92378pxb; Mon, 13 Sep 2021 13:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIfMyoQCIC/s6AckasaEULvFrA5h4ZUY26RsWbJpignwO9UFbOSNbnnovPUIQc+m1sYN4a X-Received: by 2002:a05:6402:27c6:: with SMTP id c6mr15154412ede.111.1631566331323; Mon, 13 Sep 2021 13:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631566331; cv=none; d=google.com; s=arc-20160816; b=o3o1ACiXy1qUvjOzmNKn/o9Te0KtXyoiQxR3Jn2tkX/LJGEyvx64ToClJZV5BC9RwD wKqpi7u+Wlqs3jwShxgsVWMgmdNzsbwy2Y4VdAvH2uhvC2oV1mzfYnIpiz61C+vIN0JH 9Z33TEALblraEkySCTYotNCmJ2p+qx/GFdCFFnQunzymWJQ/yB53x3Im181jwRbk0eVi 0e+Yo0vlq3ILqa/mxSUd2Gi2GFPoeYlC9bU6XpLM6SGMd8mYcRvTDnAWRDLS3NgNlR9e +r5MlUpC6a2dnoA1gVJeSRRSDupcxbHXPgoFKrcKwhby5oEmngsbTvG147T/k9naOV/z yVPw== 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=8Fa7gCH+bjdoHmDpVJkJ8QpZxy/K7yHLTBiEQii0qCk=; b=hQZuKyHNFA31KDDiiNXyonz/7ivk63g7jEi2y7VYhayGbQDM9H/aA1oJokHzydSazl Rq523v8w3iLpH6lbQb+80Eh6LrNun1DsL/uJ4PoL36rTdr/hwVeyhNI3ESj20ANyZFDb s05kxzSFeQANS4tn3cWXOpdamPiwgtqpFrHXDhDVlw5lHqRNyHgk41jHPxt6ladiy+kE RHtIIktjQ20vhLpdRKAPL9K9fc8e1Pe3eGYRbGyHl/ovIHsFj/ky9k5e6ubhwpfUFpse Cd02UyNnw/bCh6I5shjttxQYvfwOEnBXB7XoFtvRoENypGabgKdp2mv21Zvok0Op2mwi ETPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ovfw2vMj; 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 c15si8671703ejz.158.2021.09.13.13.51.47; Mon, 13 Sep 2021 13:52:11 -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=Ovfw2vMj; 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 S241651AbhIMNwU (ORCPT + 99 others); Mon, 13 Sep 2021 09:52:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:51542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241811AbhIMNsm (ORCPT ); Mon, 13 Sep 2021 09:48:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E1EB6136A; Mon, 13 Sep 2021 13:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539968; bh=CqTNXo0ltfAE2HkV1PFuv5rcNj/dIO288iHZCXlxNcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ovfw2vMjz1G+QCHCVTOTO/4vul7FJ8XgureGmBpje/w7LVyJQPAcUPRgcAoDpyiyU J3Aa2Zs3nOj7YJwWKUhCEqFKBwk9Te+OvrZSl71+jYr3GoBUe4/tONvmk0Xi9bjWDM IuRoA9/SWpONbo/Vz/gH84RYL0rfAFkhWrlNhCXs= 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.10 206/236] brcmfmac: pcie: fix oops on failure to resume and reprobe Date: Mon, 13 Sep 2021 15:15:11 +0200 Message-Id: <20210913131107.389954878@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 603aff421e38..1f12dfb33938 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