qcacld-3.0: Add null peer check before releasing the peer

Currently in driver, for non-DBS hw mode, null peer is released in the
function ndi_remove_and_update_primary_connection. This causes null
pointer deferencing.

To fix this, add null peer check before releasing the peer.

CRs-Fixed: 3184390
Change-Id: Ia895c8487082e0fac6e7df63d3694fa3e152b355
This commit is contained in:
Rahul Gusain
2022-07-05 18:14:34 +05:30
committed by Madan Koyyalamudi
parent 9d5b8a76b9
commit d7b141370b

View File

@@ -465,7 +465,9 @@ ndi_remove_and_update_primary_connection(struct wlan_objmgr_psoc *psoc,
policy_mgr_check_n_start_opportunistic_timer(psoc);
}
wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);
if (peer)
wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);
return QDF_STATUS_SUCCESS;
}