From 1720a91d03e84daa68e5c121b59e24dbdde40d9e Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 9 Nov 2011 13:00:24 -0800 Subject: [PATCH] net: wireless: bcmdhd: Call init_ioctl() only if was started properly Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcmdhd/wl_android.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c index 7c6ab2fb2821..9ca3d6020239 100644 --- a/drivers/net/wireless/bcmdhd/wl_android.c +++ b/drivers/net/wireless/bcmdhd/wl_android.c @@ -364,7 +364,8 @@ int wl_android_wifi_on(struct net_device *dev) sdioh_start(NULL, 0); ret = dhd_dev_reset(dev, FALSE); sdioh_start(NULL, 1); - dhd_dev_init_ioctl(dev); + if (!ret) + dhd_dev_init_ioctl(dev); g_wifi_on = 1; } dhd_net_if_unlock(dev); @@ -384,7 +385,7 @@ int wl_android_wifi_off(struct net_device *dev) dhd_net_if_lock(dev); if (g_wifi_on) { - dhd_dev_reset(dev, 1); + ret = dhd_dev_reset(dev, TRUE); sdioh_stop(NULL); dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF); g_wifi_on = 0; -- 2.34.1