Parcourir la source

qcacld-3.0: Fix reference leaks for dev_hold

hdd_for_each_adapter_dev_held_safe will call the dev_hold for each
iteration. This is to make sure that net device is not being deleted
in between the iteration. dev_put has to be done at the end of each
iteration. There are few instances in the driver where this dev_put
is missing. This will block the driver unregistration due to missing
dev_put.

To resolve this, fix all missing dev_put calls in the driver while
using hdd_for_each_adapter_dev_held_safe.

Change-Id: I1c5560ebc4abcd5eee09e03b5cba39d481398f8c
CRs-Fixed: 2824505
Bapiraju Alla il y a 4 ans
Parent
commit
4876954f67
2 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 2 0
      core/hdd/src/wlan_hdd_hang_event.c
  2. 2 0
      core/hdd/src/wlan_hdd_main.c

+ 2 - 0
core/hdd/src/wlan_hdd_hang_event.c

@@ -88,6 +88,8 @@ static int wlan_hdd_recovery_notifier_call(struct notifier_block *block,
 				QDF_WLAN_HANG_FW_OFFSET) {
 			hdd_objmgr_put_vdev(vdev);
 			dev_put(adapter->dev);
+			if (next_adapter)
+				dev_put(next_adapter->dev);
 			return NOTIFY_STOP_MASK;
 		}
 		cmd = (struct hdd_hang_event_fixed_param *)hdd_buf_ptr;

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8524,6 +8524,7 @@ struct hdd_adapter *hdd_get_adapter_by_rand_macaddr(
 				dev_put(next_adapter->dev);
 			return adapter;
 		}
+		dev_put(adapter->dev);
 	}
 
 	return NULL;
@@ -18239,6 +18240,7 @@ wlan_hdd_del_p2p_interface(struct hdd_context *hdd_ctx)
 			if (vdev_sync)
 				osif_vdev_sync_destroy(vdev_sync);
 		}
+		dev_put(adapter->dev);
 	}
 }