diff options
Diffstat (limited to 'drivers/staging/wilc1000/netdev.c')
-rw-r--r-- | drivers/staging/wilc1000/netdev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c index 3fd8e008f733..960dbc8d5173 100644 --- a/drivers/staging/wilc1000/netdev.c +++ b/drivers/staging/wilc1000/netdev.c @@ -837,7 +837,7 @@ static const struct net_device_ops wilc_netdev_ops = { void wilc_netdev_cleanup(struct wilc *wilc) { struct wilc_vif *vif; - int srcu_idx; + int srcu_idx, ifc_cnt = 0; if (!wilc) return; @@ -858,7 +858,7 @@ void wilc_netdev_cleanup(struct wilc *wilc) flush_workqueue(wilc->hif_workqueue); destroy_workqueue(wilc->hif_workqueue); - do { + while (ifc_cnt < WILC_NUM_CONCURRENT_IFC) { mutex_lock(&wilc->vif_mutex); if (wilc->vif_num <= 0) { mutex_unlock(&wilc->vif_mutex); @@ -871,7 +871,8 @@ void wilc_netdev_cleanup(struct wilc *wilc) wilc->vif_num--; mutex_unlock(&wilc->vif_mutex); synchronize_srcu(&wilc->srcu); - } while (1); + ifc_cnt++; + } wilc_wlan_cfg_deinit(wilc); wlan_deinit_locks(wilc); |