Kaynağa Gözat

qcacld-3.0: Validate hdd_ctx before dereferencing

Currently in the function wlan_hdd_put_mlo_peer_link_id,
the hdd_ctx is dereferenced before validating it. It can
cause a potential Null pointer dereference. To avoid that,
validate hdd_ctx before using it.

Change-Id: I15dc23c594a48bc8585c3ff0d68ddd131f85706d
CRs-Fixed: 3565152
Aditya Kodukula 1 yıl önce
ebeveyn
işleme
1fd3f29a9e
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      core/hdd/src/wlan_hdd_stats.c

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

@@ -758,6 +758,9 @@ wlan_hdd_put_mlo_peer_link_id(struct sk_buff *vendor_event,
 	struct wlan_hdd_link_info *link_info;
 	struct wlan_hdd_mlo_iface_stats_info info = {0};
 
+	if (wlan_hdd_validate_context(hdd_ctx))
+		return false;
+
 	link_info = hdd_get_link_info_by_bssid(hdd_ctx,
 					       (const uint8_t *)bssid->bytes);
 	if (!link_info) {