mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
cxgb4: fix a memory leak bug
[ Upstream commit c554336efa ]
In blocked_fl_write(), 't' is not deallocated if bitmap_parse_user() fails,
leading to a memory leak bug. To fix this issue, free t before returning
the error.
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
91910cc001
commit
8762d3ea41
@@ -2777,8 +2777,10 @@ static ssize_t blocked_fl_write(struct file *filp, const char __user *ubuf,
|
||||
return -ENOMEM;
|
||||
|
||||
err = bitmap_parse_user(ubuf, count, t, adap->sge.egr_sz);
|
||||
if (err)
|
||||
if (err) {
|
||||
kvfree(t);
|
||||
return err;
|
||||
}
|
||||
|
||||
bitmap_copy(adap->sge.blocked_fl, t, adap->sge.egr_sz);
|
||||
kvfree(t);
|
||||
|
||||
Reference in New Issue
Block a user