Prechádzať zdrojové kódy

qcacld-3.0: Add check before mem free

During legacy to mlo roaming,lim join req memory
is malloced and new pe session is created for
link vdev. In success case, pe_roam_sync_callback(),
deletes the old pe session and lim_join_req
memory will be freed.

In lim_cm_fill_link_session() free lim_join_req
only in case of failures.

Change-Id: I1b156a0dd778880c3a9664fa333d34eb18afcee1
CRs-Fixed: 3121153
Amruta Kulkarni 3 rokov pred
rodič
commit
5452c309d5
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      core/mac/src/pe/lim/lim_api.c

+ 2 - 1
core/mac/src/pe/lim/lim_api.c

@@ -3225,7 +3225,8 @@ lim_cm_fill_link_session(struct mac_context *mac_ctx,
 		pe_session->limMlmState = eLIM_MLM_WT_REASSOC_RSP_STATE;
 	}
 end:
-	qdf_mem_free(pe_session->lim_join_req);
+	if (QDF_IS_STATUS_ERROR(status))
+		qdf_mem_free(pe_session->lim_join_req);
 	return status;
 }