summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorEyal Reizer <eyalreizer@gmail.com>2018-05-28 11:36:42 +0300
committerKalle Valo <kvalo@codeaurora.org>2018-05-29 10:20:56 +0300
commit6e91d48371e79862ea2c05867aaebe4afe55a865 (patch)
tree54a601415955c120d9f5dd298a756f2d2a07a175 /drivers/net/wireless/ti
parent88027c8ff0a3f87d5d06d53ee25a41b90d8bccec (diff)
downloadlinux-6e91d48371e79862ea2c05867aaebe4afe55a865.tar.bz2
wlcore: sdio: check for valid platform device data before suspend
the wl pointer can be null In case only wlcore_sdio is probed while no WiLink module is successfully probed, as in the case of mounting a wl12xx module while using a device tree file configured with wl18xx related settings. In this case the system was crashing in wl1271_suspend() as platform device data is not set. Make sure wl the pointer is valid before using it. Signed-off-by: Eyal Reizer <eyalr@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wlcore/sdio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 15d5ac126061..750bea3574ee 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -399,6 +399,11 @@ static int wl1271_suspend(struct device *dev)
mmc_pm_flag_t sdio_flags;
int ret = 0;
+ if (!wl) {
+ dev_err(dev, "no wilink module was probed\n");
+ goto out;
+ }
+
dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
wl->wow_enabled);