]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.17.12/wlcore-sdio-check-for-valid-platform-device-data-before-suspend.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.17.12 / wlcore-sdio-check-for-valid-platform-device-data-before-suspend.patch
CommitLineData
722b7c48
GKH
1From foo@baz Sat Jul 28 10:14:30 CEST 2018
2From: Eyal Reizer <eyalreizer@gmail.com>
3Date: Mon, 28 May 2018 11:36:42 +0300
4Subject: wlcore: sdio: check for valid platform device data before suspend
5
6From: Eyal Reizer <eyalreizer@gmail.com>
7
8[ Upstream commit 6e91d48371e79862ea2c05867aaebe4afe55a865 ]
9
10the wl pointer can be null In case only wlcore_sdio is probed while
11no WiLink module is successfully probed, as in the case of mounting a
12wl12xx module while using a device tree file configured with wl18xx
13related settings.
14In this case the system was crashing in wl1271_suspend() as platform
15device data is not set.
16Make sure wl the pointer is valid before using it.
17
18Signed-off-by: Eyal Reizer <eyalr@ti.com>
19Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
20Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/net/wireless/ti/wlcore/sdio.c | 5 +++++
24 1 file changed, 5 insertions(+)
25
26--- a/drivers/net/wireless/ti/wlcore/sdio.c
27+++ b/drivers/net/wireless/ti/wlcore/sdio.c
28@@ -406,6 +406,11 @@ static int wl1271_suspend(struct device
29 mmc_pm_flag_t sdio_flags;
30 int ret = 0;
31
32+ if (!wl) {
33+ dev_err(dev, "no wilink module was probed\n");
34+ goto out;
35+ }
36+
37 dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
38 wl->wow_enabled);
39