qcacmn: add psoc null check before passing to wlan_objmgr_get_peer_by_mac

Current code directly passes the result of wlan_vdev_get_psoc(vdev) to
wlan_objmgr_get_peer_by_mac, without null pointer checking, which can
result in null pointer dereferencing.
To fix this issue, add checking of the psoc pointer before passing to
wlan_objmgr_get_peer_by_mac.

Change-Id: Ica5ebbc448a6da8b1e7c846f05773d95f995eaca
CRs-Fixed: 3327337
This commit is contained in:
Mohammed Ahmed
2022-11-03 11:15:39 -07:00
committed by Madan Koyyalamudi
parent 8791a90b2d
commit b36ae3c3aa

View File

@@ -496,9 +496,14 @@ osif_fill_peer_mld_mac_connect_resp(struct wlan_objmgr_vdev *vdev,
struct cfg80211_connect_resp_params *conn_rsp_params)
{
struct wlan_objmgr_peer *peer_obj;
struct wlan_objmgr_psoc *psoc;
peer_obj = wlan_objmgr_get_peer_by_mac(wlan_vdev_get_psoc(vdev),
rsp->bssid.bytes, WLAN_OSIF_ID);
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc)
return QDF_STATUS_E_INVAL;
peer_obj = wlan_objmgr_get_peer_by_mac(psoc, rsp->bssid.bytes,
WLAN_OSIF_ID);
if (!peer_obj)
return QDF_STATUS_E_INVAL;