summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh2019-02-05 08:15:31 +0100
committerGreg Kroah-Hartman2019-02-07 13:31:19 +0100
commit3c55a24ee2762b11446cc816fa9a1ca739a9c1ce (patch)
tree88f6fb89c4b8f16d362c4d8ace90ec4a2086eb1c /drivers/staging/wilc1000
parentstaging: wilc1000: refactor scan() cfg80211 ops callback (diff)
downloadkernel-qcow2-linux-3c55a24ee2762b11446cc816fa9a1ca739a9c1ce.tar.gz
kernel-qcow2-linux-3c55a24ee2762b11446cc816fa9a1ca739a9c1ce.tar.xz
kernel-qcow2-linux-3c55a24ee2762b11446cc816fa9a1ca739a9c1ce.zip
staging: wilc1000: remove use of 'terminated_handle' static variable
Remove use of 'terminated_handle' variable and set the 'hif_drv' to NULL once it's free. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 357683461a77..97bf747295be 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -130,7 +130,6 @@ struct wilc_join_bss_param {
};
} __packed;
-static struct host_if_drv *terminated_handle;
static struct mutex hif_deinit_lock;
/* 'msg' should be free by the caller for syc */
@@ -1478,6 +1477,9 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode,
int result;
struct wilc_drv_handler drv;
+ if (!hif_drv)
+ return -EFAULT;
+
wid.id = WID_SET_DRV_HANDLER;
wid.type = WID_STR;
wid.size = sizeof(drv);
@@ -1699,8 +1701,6 @@ int wilc_deinit(struct wilc_vif *vif)
mutex_lock(&hif_deinit_lock);
- terminated_handle = hif_drv;
-
del_timer_sync(&hif_drv->scan_timer);
del_timer_sync(&hif_drv->connect_timer);
del_timer_sync(&vif->periodic_rssi);
@@ -1717,9 +1717,8 @@ int wilc_deinit(struct wilc_vif *vif)
hif_drv->hif_state = HOST_IF_IDLE;
kfree(hif_drv);
-
+ vif->hif_drv = NULL;
vif->wilc->clients_count--;
- terminated_handle = NULL;
mutex_unlock(&hif_deinit_lock);
return result;
}
@@ -1738,7 +1737,7 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length)
return;
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle) {
+ if (!hif_drv) {
netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv);
return;
}
@@ -1784,7 +1783,7 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length)
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle) {
+ if (!hif_drv) {
mutex_unlock(&hif_deinit_lock);
return;
}
@@ -1824,7 +1823,7 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length)
return;
hif_drv = vif->hif_drv;
- if (!hif_drv || hif_drv == terminated_handle)
+ if (!hif_drv)
return;
if (hif_drv->usr_scan_req.scan_result) {