Skip to content

Commit cc28e4b

Browse files
glenlee75gregkh
authored andcommitted
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(a4ab1ad). Fixes: a4ab1ad ("staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv") Signed-off-by: Glen Lee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c8751ad commit cc28e4b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/staging/wilc1000/host_interface.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,9 +1385,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
13851385

13861386
hif_drv->usr_conn_req.ssid_len = 0;
13871387
kfree(hif_drv->usr_conn_req.pu8ssid);
1388+
hif_drv->usr_conn_req.pu8ssid = NULL;
13881389
kfree(hif_drv->usr_conn_req.pu8bssid);
1390+
hif_drv->usr_conn_req.pu8bssid = NULL;
13891391
hif_drv->usr_conn_req.ies_len = 0;
13901392
kfree(hif_drv->usr_conn_req.ies);
1393+
hif_drv->usr_conn_req.ies = NULL;
13911394

13921395
eth_zero_addr(wilc_connected_ssid);
13931396

@@ -1641,9 +1644,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
16411644
strConnectInfo.pu8ReqIEs = NULL;
16421645
hif_drv->usr_conn_req.ssid_len = 0;
16431646
kfree(hif_drv->usr_conn_req.pu8ssid);
1647+
hif_drv->usr_conn_req.pu8ssid = NULL;
16441648
kfree(hif_drv->usr_conn_req.pu8bssid);
1649+
hif_drv->usr_conn_req.pu8bssid = NULL;
16451650
hif_drv->usr_conn_req.ies_len = 0;
16461651
kfree(hif_drv->usr_conn_req.ies);
1652+
hif_drv->usr_conn_req.ies = NULL;
16471653
} else if ((u8MacStatus == MAC_DISCONNECTED) &&
16481654
(hif_drv->hif_state == HOST_IF_CONNECTED)) {
16491655
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,
16771683

16781684
hif_drv->usr_conn_req.ssid_len = 0;
16791685
kfree(hif_drv->usr_conn_req.pu8ssid);
1686+
hif_drv->usr_conn_req.pu8ssid = NULL;
16801687
kfree(hif_drv->usr_conn_req.pu8bssid);
1688+
hif_drv->usr_conn_req.pu8bssid = NULL;
16811689
hif_drv->usr_conn_req.ies_len = 0;
16821690
kfree(hif_drv->usr_conn_req.ies);
1691+
hif_drv->usr_conn_req.ies = NULL;
16831692

16841693
if (join_req && join_req_drv == hif_drv) {
16851694
kfree(join_req);
@@ -2049,9 +2058,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
20492058

20502059
hif_drv->usr_conn_req.ssid_len = 0;
20512060
kfree(hif_drv->usr_conn_req.pu8ssid);
2061+
hif_drv->usr_conn_req.pu8ssid = NULL;
20522062
kfree(hif_drv->usr_conn_req.pu8bssid);
2063+
hif_drv->usr_conn_req.pu8bssid = NULL;
20532064
hif_drv->usr_conn_req.ies_len = 0;
20542065
kfree(hif_drv->usr_conn_req.ies);
2066+
hif_drv->usr_conn_req.ies = NULL;
20552067

20562068
if (join_req && join_req_drv == hif_drv) {
20572069
kfree(join_req);

0 commit comments

Comments
 (0)