summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorSebastian Siewior <bigeasy@linutronix.de>2015-11-26 23:23:49 +0300
committerRichard Weinberger <richard@nod.at>2015-12-17 00:59:03 +0300
commit6b238de189f69dc77d660d4cce62eed15547f4c3 (patch)
treebfc45a51a777327cba3d9ed54b18e5b5e6cc0bb2 /drivers/mtd/ubi
parent1a31b20cd81d5cbc7ec6e24cb08066009a1ca32d (diff)
downloadlinux-6b238de189f69dc77d660d4cce62eed15547f4c3.tar.xz
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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/wl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index f73233fa737c..56065632a5b8 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -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;
}