From fa043534bfaebdf627eb9026cac9b11b0b89be70 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Wed, 2 Dec 2015 16:56:48 -0800 Subject: [PATCH] qcacld-3.0: Fix the issue observed in static code analysis Fix the issue observed in static code analysis. Change-Id: I3ec4abc3b51d3b36350e1f2d592ae59a21d8aa62 CRs-Fixed: 928208 --- core/sme/src/csr/csr_api_scan.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index d79e148f481a..1c3669341d2e 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -3925,10 +3925,6 @@ error: cdf_mem_free(save_cmd->u.scanCmd.u.scanRequest.SSIDs.SSIDList); if (save_cmd->u.scanCmd.pToRoamProfile) cdf_mem_free(save_cmd->u.scanCmd.pToRoamProfile); - if (save_cmd) { - cdf_mem_free(save_cmd); - save_cmd = NULL; - } return CDF_STATUS_E_FAILURE; } @@ -4019,11 +4015,11 @@ csr_handle_nxt_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *pCommand, } status = csr_save_profile(mac_ctx, save_cmd, pCommand); - if (!CDF_IS_STATUS_SUCCESS(status) || - !save_cmd) { + if (!CDF_IS_STATUS_SUCCESS(status)) { /* csr_save_profile should report error */ sms_log(mac_ctx, LOGE, FL("profile save failed %d"), status); + cdf_mem_free(save_cmd); return; }