提交 2326aa01 编写于 作者: W Wei Yongjun 提交者: Kalle Valo

ath10k: fix possible memory leak in ath10k_bmi_lz_data_large()

'cmd' is malloced in ath10k_bmi_lz_data_large() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: d58f466a ("ath10k: add large size for BMI download data for SDIO")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200427104348.13570-1-weiyongjun1@huawei.com
上级 69c93f96
...@@ -380,6 +380,7 @@ static int ath10k_bmi_lz_data_large(struct ath10k *ar, const void *buffer, u32 l ...@@ -380,6 +380,7 @@ static int ath10k_bmi_lz_data_large(struct ath10k *ar, const void *buffer, u32 l
NULL, NULL); NULL, NULL);
if (ret) { if (ret) {
ath10k_warn(ar, "unable to write to the device\n"); ath10k_warn(ar, "unable to write to the device\n");
kfree(cmd);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册