提交 7f0e5a05 编写于 作者: A Ahmad Fatoum 提交者: Zheng Zengkai

brcmfmac: pcie: fix oops on failure to resume and reprobe

stable inclusion
from stable-5.10.65
commit 4663aaef24dffd004fa030b7434de7a7e9a34f26
bugzilla: 182361 https://gitee.com/openeuler/kernel/issues/I4EH3U

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4663aaef24dffd004fa030b7434de7a7e9a34f26

--------------------------------

[ Upstream commit d745ca4f ]

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: 8602e624 ("brcmfmac: pass bus to the __brcmf_err() in pcie.c")
Signed-off-by: NAhmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210817063521.22450-1-a.fatoum@pengutronix.deSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0971895f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册