From: Glen Lee Date: Fri, 18 Dec 2015 09:26:02 +0000 (+0900) Subject: staging: wilc1000: fix a bug when unload driver X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cc28e4bf6e5279728c4b03497e95b9a5f5054f9c;p=linux-beck.git staging: wilc1000: fix a bug when unload driver kernel crashes when load and unload driver several times. I used git bisect to track down and found that removing NULL setting caused the panic. This reverts only related codes of the patch(a4ab1ade75a3). Fixes: a4ab1ade75a3 ("staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv") Signed-off-by: Glen Lee Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 772d524bc2b4..36303c310c2c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1385,9 +1385,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv) hif_drv->usr_conn_req.ssid_len = 0; kfree(hif_drv->usr_conn_req.pu8ssid); + hif_drv->usr_conn_req.pu8ssid = NULL; kfree(hif_drv->usr_conn_req.pu8bssid); + hif_drv->usr_conn_req.pu8bssid = NULL; hif_drv->usr_conn_req.ies_len = 0; kfree(hif_drv->usr_conn_req.ies); + hif_drv->usr_conn_req.ies = NULL; eth_zero_addr(wilc_connected_ssid); @@ -1641,9 +1644,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv, strConnectInfo.pu8ReqIEs = NULL; hif_drv->usr_conn_req.ssid_len = 0; kfree(hif_drv->usr_conn_req.pu8ssid); + hif_drv->usr_conn_req.pu8ssid = NULL; kfree(hif_drv->usr_conn_req.pu8bssid); + hif_drv->usr_conn_req.pu8bssid = NULL; hif_drv->usr_conn_req.ies_len = 0; kfree(hif_drv->usr_conn_req.ies); + hif_drv->usr_conn_req.ies = NULL; } else if ((u8MacStatus == MAC_DISCONNECTED) && (hif_drv->hif_state == HOST_IF_CONNECTED)) { PRINT_D(HOSTINF_DBG, "Received MAC_DISCONNECTED from the FW\n"); @@ -1677,9 +1683,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv, hif_drv->usr_conn_req.ssid_len = 0; kfree(hif_drv->usr_conn_req.pu8ssid); + hif_drv->usr_conn_req.pu8ssid = NULL; kfree(hif_drv->usr_conn_req.pu8bssid); + hif_drv->usr_conn_req.pu8bssid = NULL; hif_drv->usr_conn_req.ies_len = 0; kfree(hif_drv->usr_conn_req.ies); + hif_drv->usr_conn_req.ies = NULL; if (join_req && join_req_drv == hif_drv) { kfree(join_req); @@ -2049,9 +2058,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv) hif_drv->usr_conn_req.ssid_len = 0; kfree(hif_drv->usr_conn_req.pu8ssid); + hif_drv->usr_conn_req.pu8ssid = NULL; kfree(hif_drv->usr_conn_req.pu8bssid); + hif_drv->usr_conn_req.pu8bssid = NULL; hif_drv->usr_conn_req.ies_len = 0; kfree(hif_drv->usr_conn_req.ies); + hif_drv->usr_conn_req.ies = NULL; if (join_req && join_req_drv == hif_drv) { kfree(join_req);