summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Siewior <bigeasy@linutronix.de>2016-05-27 09:44:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-27 12:30:27 +0200
commitc5576d8a3a2951b1e90fabef1f202d092ab45a9c (patch)
tree5c79b2219d93fd8810129c5b2957be5eee7157fd
parent6c5c4a4171b885a8ff7e340d9a81914a42db8930 (diff)
downloadbarebox-c5576d8a3a2951b1e90fabef1f202d092ab45a9c.tar.gz
barebox-c5576d8a3a2951b1e90fabef1f202d092ab45a9c.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> Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-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 1feef3fd0d..e81f796985 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1015,6 +1015,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;
}