Browse Source

qcacld-3.0: Don't set adapter dev to NULL in hostapd unint

With the existing design the panic is seen with the below
scenario.
1) As a part of country change, driver takes the dev_hold and proceed
   with the adapter access.
2) In another thread, del virtual iface is called which calls the
   unregister netdev. This kernel API(unregister netdev) calls the
   hdd_hostapd_unint where the adapter->dev is set to NULL. After
   this  unregister_netdev waits for the dev_put as driver has
   taken the dev_hold in 1). Till this dev_put happens
   unregister_netdev will wait.
3) Once the adapter access is completed as a part of 1), driver
   does the dev_put with the pointer dev which is made as NULL in 2).

To avoid this crash, don't set the adapter->dev to NULL in
hostapd unint.

CRs-Fixed: 2791420
Change-Id: I1f6252a44c061b697c8d640c5558350e91a47442
Sachin Ahuja 4 years ago
parent
commit
7573521973
1 changed files with 0 additions and 1 deletions
  1. 0 1
      core/hdd/src/wlan_hdd_hostapd.c

+ 0 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -603,7 +603,6 @@ static void hdd_hostapd_uninit(struct net_device *dev)
 	hdd_deinit_adapter(hdd_ctx, adapter, true);
 
 	/* after uninit our adapter structure will no longer be valid */
-	adapter->dev = NULL;
 	adapter->magic = 0;
 
 	hdd_exit();