From e5582aa7efb771bb7611de7b5438ec8bdd4032f7 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Wed, 2 May 2018 18:20:20 +0530 Subject: [PATCH] qcacld-3.0: Avoid NULL pointer exception in (re)assoc event In hdd_send_association_event() and hdd_send_re_assoc_event(), there is no check of pBssDesc against NULL which can lead to NULL pointer exception. Circumvent this issue by adding NULL check. Change-Id: Ic3a0142b4ea3f058e8d3993fb491d418ddb8f70d CRs-Fixed: 2232721 --- core/hdd/src/wlan_hdd_assoc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index deeebc6fe1b5..a4acfe48493d 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1327,7 +1327,7 @@ static void hdd_send_association_event(struct net_device *dev, if (eConnectionState_Associated == sta_ctx->conn_info.connState) { tSirSmeChanInfo chan_info = {0}; - if (!pCsrRoamInfo) { + if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) { hdd_warn("STA in associated state but pCsrRoamInfo is null"); return; } @@ -2311,7 +2311,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev, hdd_err("Unable to allocate Assoc Req IE"); goto done; } - if (pCsrRoamInfo == NULL) { + + if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) { hdd_err("Invalid CSR roam info"); goto done; }