提交 341e1a0c 编写于 作者: A Artem Bityutskiy

UBI: fix memory leak in checking code

Reported-by: NEric Sesterhenn / Snakebyte <snakebyte@gmx.de>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册