Commit 341e1a0c authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: fix memory leak in checking code

Reported-by: default avatarEric Sesterhenn / Snakebyte <snakebyte@gmx.de>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent cb32da04
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment