summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <naveenrawat@codeaurora.org>2016-11-17 12:01:22 -0800
committerqcabuildsw <qcabuildsw@localhost>2016-11-22 20:11:31 -0800
commitf7ca1d8b4d993aa26a4f49529e52dd0e7c81bff1 (patch)
treeec76bb60e50dcd30780e922ff2d8daddc91c5837
parent6c9ffda7c04766cfa18d14752c38e457db323c2c (diff)
qcacld-3.0: Check condition before loop in csr_get_active_scan_entry
In function csr_get_active_scan_entry change do while to while loop so that localentry could be checked before entering loop and avoid null pointer dereference. Change-Id: I12cb84b38636ce0d97d7ddf01ad7ed7cd414e80c CRs-Fixed: 1091486
-rw-r--r--core/sme/src/csr/csr_api_scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index 83bc4ff9ad1e..680f5bb0fbee 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -4171,7 +4171,7 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
}
localentry = csr_ll_peek_head(&mac_ctx->sme.smeScanCmdActiveList,
LL_ACCESS_NOLOCK);
- do {
+ while (localentry) {
cmd = GET_BASE_ADDR(localentry, tSmeCmd, Link);
if (cmd->command == eSmeCommandScan)
cmd_scan_id = cmd->u.scanCmd.u.scanRequest.scan_id;
@@ -4186,7 +4186,7 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
}
localentry = csr_ll_next(&mac_ctx->sme.smeScanCmdActiveList,
localentry, LL_ACCESS_NOLOCK);
- } while (localentry);
+ }
csr_ll_unlock(&mac_ctx->sme.smeScanCmdActiveList);
return status;
}