From 6f7a99c4f4518823d82cc96f88b92393ac6de67f Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Thu, 26 Apr 2018 09:46:39 +0530 Subject: [PATCH] qcacmn: Fix memory leak in WMI In case of invalid MIMO PS config in wmi cmd, wmi cmd is not sent and we return. This leads to memory leak as wmi net buf allocated is not freed before returning. Fix the memory leak by freeing the wmi net buf in such case before return. Change-Id: I7f353f0b4d84a663801482a9c28296371bea3b89 CRs-fixed: 2230346 --- wmi/src/wmi_unified_tlv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index a54d60359cfc..562dd35d389c 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -3347,6 +3347,7 @@ static QDF_STATUS send_set_mimops_cmd_tlv(wmi_unified_t wmi_handle, break; default: WMI_LOGE("%s:INVALID Mimo PS CONFIG", __func__); + wmi_buf_free(buf); return QDF_STATUS_E_FAILURE; }