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
This commit is contained in:
Aditya Kodukula
2023-07-20 13:15:55 -07:00
committed by Rahul Choudhary
parent 4b4b76694a
commit 1fd3f29a9e

View File

@@ -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) {