Selaa lähdekoodia

qcacld-3.0: Validate adapter before use in LL_STATS

Currently, in the function hdd_cache_ll_iface_stats,
the adapter is dereferenced without validating it.
To avoid possible null-pointer dereference, add a check
to validate the adapter.

Change-Id: I6a905db2ada90243f178237bab41fd975789b8c1
CRs-Fixed: 3273525
Aditya Kodukula 2 vuotta sitten
vanhempi
sitoutus
4da4073cd3
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      core/hdd/src/wlan_hdd_stats.c

+ 4 - 0
core/hdd/src/wlan_hdd_stats.c

@@ -1036,6 +1036,10 @@ hdd_cache_ll_iface_stats(struct hdd_context *hdd_ctx,
 	struct hdd_adapter *adapter;
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, if_stat->vdev_id);
+	if (!adapter) {
+		hdd_err("Invalid adapter for LL_STATS");
+		return;
+	}
 	/*
 	 * There is no need for wlan_hdd_validate_context here. This is a NB
 	 * operation that will come with DSC synchronization. This ensures that