From 748776ef202b37dcf51ae95df1d7ed21e71b1f3c Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Thu, 23 Apr 2020 11:17:28 +0530 Subject: [PATCH] qcacld-3.0: Add check for pesession before accessing it In function lim_send_probe_req_mgmt_frame, pesession is being used without sanity check. Add sanity check for pesession. Change-Id: Iea52db4399cc50e4e7cd99bec92677e845274153 CRs-Fixed: 2668308 --- .../mac/src/pe/lim/lim_send_management_frames.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 283942565db3..39d60b43578d 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -350,13 +350,18 @@ lim_send_probe_req_mgmt_frame(struct mac_context *mac_ctx, SIR_MAC_QCN_OUI_TYPE_SIZE, additional_ie, addn_ielen); } + /* Add qcn_ie only if qcn ie is not present in additional_ie */ - if (!qcn_ie) - populate_dot11f_qcn_ie(mac_ctx, pesession, - &pr.qcn_ie, QCN_IE_ATTR_ID_ALL); - else - populate_dot11f_qcn_ie(mac_ctx, pesession, - &pr.qcn_ie, QCN_IE_ATTR_ID_VHT_MCS11); + if (pesession) { + if (!qcn_ie) + populate_dot11f_qcn_ie(mac_ctx, pesession, + &pr.qcn_ie, + QCN_IE_ATTR_ID_ALL); + else + populate_dot11f_qcn_ie(mac_ctx, pesession, + &pr.qcn_ie, + QCN_IE_ATTR_ID_VHT_MCS11); + } /* * Extcap IE now support variable length, merge Extcap IE from addn_ie