Commit cc28e4bf authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

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(a4ab1ade).

Fixes: a4ab1ade ("staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv")
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c8751ad7
...@@ -1385,9 +1385,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv) ...@@ -1385,9 +1385,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
hif_drv->usr_conn_req.ssid_len = 0; hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.pu8ssid); kfree(hif_drv->usr_conn_req.pu8ssid);
hif_drv->usr_conn_req.pu8ssid = NULL;
kfree(hif_drv->usr_conn_req.pu8bssid); kfree(hif_drv->usr_conn_req.pu8bssid);
hif_drv->usr_conn_req.pu8bssid = NULL;
hif_drv->usr_conn_req.ies_len = 0; hif_drv->usr_conn_req.ies_len = 0;
kfree(hif_drv->usr_conn_req.ies); kfree(hif_drv->usr_conn_req.ies);
hif_drv->usr_conn_req.ies = NULL;
eth_zero_addr(wilc_connected_ssid); eth_zero_addr(wilc_connected_ssid);
...@@ -1641,9 +1644,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv, ...@@ -1641,9 +1644,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
strConnectInfo.pu8ReqIEs = NULL; strConnectInfo.pu8ReqIEs = NULL;
hif_drv->usr_conn_req.ssid_len = 0; hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.pu8ssid); kfree(hif_drv->usr_conn_req.pu8ssid);
hif_drv->usr_conn_req.pu8ssid = NULL;
kfree(hif_drv->usr_conn_req.pu8bssid); kfree(hif_drv->usr_conn_req.pu8bssid);
hif_drv->usr_conn_req.pu8bssid = NULL;
hif_drv->usr_conn_req.ies_len = 0; hif_drv->usr_conn_req.ies_len = 0;
kfree(hif_drv->usr_conn_req.ies); kfree(hif_drv->usr_conn_req.ies);
hif_drv->usr_conn_req.ies = NULL;
} else if ((u8MacStatus == MAC_DISCONNECTED) && } else if ((u8MacStatus == MAC_DISCONNECTED) &&
(hif_drv->hif_state == HOST_IF_CONNECTED)) { (hif_drv->hif_state == HOST_IF_CONNECTED)) {
PRINT_D(HOSTINF_DBG, "Received MAC_DISCONNECTED from the FW\n"); 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, ...@@ -1677,9 +1683,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
hif_drv->usr_conn_req.ssid_len = 0; hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.pu8ssid); kfree(hif_drv->usr_conn_req.pu8ssid);
hif_drv->usr_conn_req.pu8ssid = NULL;
kfree(hif_drv->usr_conn_req.pu8bssid); kfree(hif_drv->usr_conn_req.pu8bssid);
hif_drv->usr_conn_req.pu8bssid = NULL;
hif_drv->usr_conn_req.ies_len = 0; hif_drv->usr_conn_req.ies_len = 0;
kfree(hif_drv->usr_conn_req.ies); kfree(hif_drv->usr_conn_req.ies);
hif_drv->usr_conn_req.ies = NULL;
if (join_req && join_req_drv == hif_drv) { if (join_req && join_req_drv == hif_drv) {
kfree(join_req); kfree(join_req);
...@@ -2049,9 +2058,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv) ...@@ -2049,9 +2058,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
hif_drv->usr_conn_req.ssid_len = 0; hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.pu8ssid); kfree(hif_drv->usr_conn_req.pu8ssid);
hif_drv->usr_conn_req.pu8ssid = NULL;
kfree(hif_drv->usr_conn_req.pu8bssid); kfree(hif_drv->usr_conn_req.pu8bssid);
hif_drv->usr_conn_req.pu8bssid = NULL;
hif_drv->usr_conn_req.ies_len = 0; hif_drv->usr_conn_req.ies_len = 0;
kfree(hif_drv->usr_conn_req.ies); kfree(hif_drv->usr_conn_req.ies);
hif_drv->usr_conn_req.ies = NULL;
if (join_req && join_req_drv == hif_drv) { if (join_req && join_req_drv == hif_drv) {
kfree(join_req); kfree(join_req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment