Skip to content

Commit

Permalink
brcmfmac: pcie: fix oops on failure to resume and reprobe
Browse files Browse the repository at this point in the history
[ Upstream commit d745ca4 ]

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: 8602e62 ("brcmfmac: pass bus to the __brcmf_err() in pcie.c")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210817063521.22450-1-a.fatoum@pengutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
a3f authored and gregkh committed Sep 15, 2021
1 parent e68128e commit 4663aae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
Expand Up @@ -2073,7 +2073,7 @@ static int brcmf_pcie_pm_leave_D3(struct device *dev)

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;
}
Expand Down

0 comments on commit 4663aae

Please sign in to comment.