Merge "qcacld-3.0: Fix memory leak in lim_send_assoc_req_mgmt_frame"

Cette révision appartient à :
Linux Build Service Account
2017-07-16 20:42:49 -07:00
révisé par Gerrit - the friendly Code Review server
révision a57b5b9067

Voir le fichier

@@ -1636,6 +1636,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
if (NULL == pe_session) { if (NULL == pe_session) {
pe_err("pe_session is NULL"); pe_err("pe_session is NULL");
qdf_mem_free(mlm_assoc_req);
return; return;
} }
@@ -1644,6 +1645,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
/* check this early to avoid unncessary operation */ /* check this early to avoid unncessary operation */
if (NULL == pe_session->pLimJoinReq) { if (NULL == pe_session->pLimJoinReq) {
pe_err("pe_session->pLimJoinReq is NULL"); pe_err("pe_session->pLimJoinReq is NULL");
qdf_mem_free(mlm_assoc_req);
return; return;
} }
add_ie_len = pe_session->pLimJoinReq->addIEAssoc.length; add_ie_len = pe_session->pLimJoinReq->addIEAssoc.length;
@@ -1652,6 +1654,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
frm = qdf_mem_malloc(sizeof(tDot11fAssocRequest)); frm = qdf_mem_malloc(sizeof(tDot11fAssocRequest));
if (NULL == frm) { if (NULL == frm) {
pe_err("Unable to allocate memory"); pe_err("Unable to allocate memory");
qdf_mem_free(mlm_assoc_req);
return; return;
} }
qdf_mem_set((uint8_t *) frm, sizeof(tDot11fAssocRequest), 0); qdf_mem_set((uint8_t *) frm, sizeof(tDot11fAssocRequest), 0);
@@ -1947,8 +1950,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF, lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
(uint32_t *) &assoc_cnf); (uint32_t *) &assoc_cnf);
qdf_mem_free(frm); goto end;
return;
} }
/* Paranoia: */ /* Paranoia: */
qdf_mem_set(frame, bytes, 0); qdf_mem_set(frame, bytes, 0);
@@ -1963,8 +1965,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
if (DOT11F_FAILED(status)) { if (DOT11F_FAILED(status)) {
pe_err("Assoc request pack failure (0x%08x)", status); pe_err("Assoc request pack failure (0x%08x)", status);
cds_packet_free((void *)packet); cds_packet_free((void *)packet);
qdf_mem_free(frm); goto end;
return;
} else if (DOT11F_WARNED(status)) { } else if (DOT11F_WARNED(status)) {
pe_warn("Assoc request pack warning (0x%08x)", status); pe_warn("Assoc request pack warning (0x%08x)", status);
} }
@@ -2024,9 +2025,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
pe_err("Failed to send Association Request (%X)!", pe_err("Failed to send Association Request (%X)!",
qdf_status); qdf_status);
/* Pkt will be freed up by the callback */ /* Pkt will be freed up by the callback */
qdf_mem_free(frm);
return;
} }
end:
/* Free up buffer allocated for mlm_assoc_req */ /* Free up buffer allocated for mlm_assoc_req */
qdf_mem_free(mlm_assoc_req); qdf_mem_free(mlm_assoc_req);
mlm_assoc_req = NULL; mlm_assoc_req = NULL;