提交 8e09b7d2 编写于 作者: L Lino Sanfilippo 提交者: John W. Linville

wil6210: Fix potential memory leaks on error paths

Fix missing memory deallocation on error paths in wil_write_file_wmi()
and wil_write_file_txmgmt().
Reported-by: NAhmed Tamrawi <ahmedtamrawi@gmail.com>
Signed-off-by: NLino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: NVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 cbe1bc23
......@@ -573,8 +573,10 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
if (!frame)
return -ENOMEM;
if (copy_from_user(frame, buf, len))
if (copy_from_user(frame, buf, len)) {
kfree(frame);
return -EIO;
}
params.buf = frame;
params.len = len;
......@@ -614,8 +616,10 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
return -ENOMEM;
rc = simple_write_to_buffer(wmi, len, ppos, buf, len);
if (rc < 0)
if (rc < 0) {
kfree(wmi);
return rc;
}
cmd = &wmi[1];
cmdid = le16_to_cpu(wmi->id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册