Skip to content

Commit

Permalink
mtd: ubi: don't leak e if schedule_erase() fails
Browse files Browse the repository at this point in the history
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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Sebastian Siewior authored and Richard Weinberger committed Dec 16, 2015
1 parent 1a31b20 commit 6b238de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/ubi/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6b238de

Please sign in to comment.