linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] wlcore: sdio: check for valid platform device data before suspend
@ 2018-05-28  8:36 Eyal Reizer
  2018-05-29  7:21 ` [v2] " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Eyal Reizer @ 2018-05-28  8:36 UTC (permalink / raw)
  To: kvalo, tony, nsekhar, linux-wireless; +Cc: Eyal Reizer

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>
---
Changes since v1: Remove extra characters after signed-of-by

 drivers/net/wireless/ti/wlcore/sdio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index da701cd..aec6225 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -406,6 +406,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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [v2] wlcore: sdio: check for valid platform device data before suspend
  2018-05-28  8:36 [PATCH v2] wlcore: sdio: check for valid platform device data before suspend Eyal Reizer
@ 2018-05-29  7:21 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-05-29  7:21 UTC (permalink / raw)
  To: Eyal Reizer; +Cc: tony, nsekhar, linux-wireless, Eyal Reizer

Eyal Reizer <eyalreizer@gmail.com> wrote:

> 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>

Patch applied to wireless-drivers-next.git, thanks.

6e91d48371e7 wlcore: sdio: check for valid platform device data before suspend

-- 
https://patchwork.kernel.org/patch/10430043/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-29  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28  8:36 [PATCH v2] wlcore: sdio: check for valid platform device data before suspend Eyal Reizer
2018-05-29  7:21 ` [v2] " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).