mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
UBI: fix memory leak in checking code
Reported-by: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
cb32da0416
commit
341e1a0cf2
@ -1310,8 +1310,10 @@ static int paranoid_check_si(const struct ubi_device *ubi,
|
||||
memset(buf, 1, ubi->peb_count);
|
||||
for (pnum = 0; pnum < ubi->peb_count; pnum++) {
|
||||
err = ubi_io_is_bad(ubi, pnum);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
kfree(buf);
|
||||
return err;
|
||||
}
|
||||
else if (err)
|
||||
buf[pnum] = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user