提交 6b238de1 编写于 作者: S Sebastian Siewior 提交者: Richard Weinberger

mtd: ubi: don't leak e if schedule_erase() fails

If __erase_worker() fails to erase the EB and schedule_erase() fails as
well to do anything about it then we go RO. But that is not a reason to
leak the e argument here. Therefore clean up e.

Cc: <stable@vger.kernel.org>
Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 1a31b20c
...@@ -1060,6 +1060,7 @@ static int __erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk) ...@@ -1060,6 +1060,7 @@ static int __erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk)
/* Re-schedule the LEB for erasure */ /* Re-schedule the LEB for erasure */
err1 = schedule_erase(ubi, e, vol_id, lnum, 0); err1 = schedule_erase(ubi, e, vol_id, lnum, 0);
if (err1) { if (err1) {
wl_entry_destroy(ubi, e);
err = err1; err = err1;
goto out_ro; goto out_ro;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册