]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - 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
1 From foo@baz Sat Jul 28 10:14:30 CEST 2018
2 From: Eyal Reizer <eyalreizer@gmail.com>
3 Date: Mon, 28 May 2018 11:36:42 +0300
4 Subject: wlcore: sdio: check for valid platform device data before suspend
5
6 From: Eyal Reizer <eyalreizer@gmail.com>
7
8 [ Upstream commit 6e91d48371e79862ea2c05867aaebe4afe55a865 ]
9
10 the wl pointer can be null In case only wlcore_sdio is probed while
11 no WiLink module is successfully probed, as in the case of mounting a
12 wl12xx module while using a device tree file configured with wl18xx
13 related settings.
14 In this case the system was crashing in wl1271_suspend() as platform
15 device data is not set.
16 Make sure wl the pointer is valid before using it.
17
18 Signed-off-by: Eyal Reizer <eyalr@ti.com>
19 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
20 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
21 Signed-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