qcacmn: Unmap tx frame in error scenario in send_mgmt_cmd_tlv()
Unmap tx frame in error scenario in send_mgmt_cmd_tlv().
Change-Id: Ie16ca466fd3c1e6af5d65fec51b7dac2ef74f003
CRs-Fixed: 2188444
diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c
index f7dcd56..c689780 100644
--- a/wmi_unified_tlv.c
+++ b/wmi_unified_tlv.c
@@ -3111,7 +3111,7 @@
QDF_DMA_TO_DEVICE);
if (status != QDF_STATUS_SUCCESS) {
WMI_LOGE("%s: wmi buf map failed", __func__);
- goto err1;
+ goto free_buf;
}
dma_addr = qdf_nbuf_get_frag_paddr(param->tx_frame, 0);
@@ -3132,7 +3132,7 @@
if (status != QDF_STATUS_SUCCESS) {
WMI_LOGE("%s: Populate TX send params failed",
__func__);
- goto err1;
+ goto unmap_tx_frame;
}
cmd_len += sizeof(wmi_tx_send_params);
}
@@ -3140,11 +3140,14 @@
if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len,
WMI_MGMT_TX_SEND_CMDID)) {
WMI_LOGE("%s: Failed to send mgmt Tx", __func__);
- goto err1;
+ goto unmap_tx_frame;
}
return QDF_STATUS_SUCCESS;
-err1:
+unmap_tx_frame:
+ qdf_nbuf_unmap_single(qdf_ctx, param->tx_frame,
+ QDF_DMA_TO_DEVICE);
+free_buf:
wmi_buf_free(buf);
return QDF_STATUS_E_FAILURE;
}