Commit 3cb22ae1 authored by Sebastian Siewior's avatar Sebastian Siewior Committed by Kamal Mostafa

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

commit 6b238de1 upstream.

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.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 041ef7d9
......@@ -1060,6 +1060,7 @@ static int __erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk)
/* Re-schedule the LEB for erasure */
err1 = schedule_erase(ubi, e, vol_id, lnum, 0);
if (err1) {
wl_entry_destroy(ubi, e);
err = err1;
goto out_ro;
}
......
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