Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1333931 > unrolled thread

[PATCH 4.3 058/200] mtd: ubi: dont leak e if schedule_erase() fails

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-02-15 01:10 +0100
Last post2016-02-15 01:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.3 058/200] mtd: ubi: dont leak e if schedule_erase() fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:10 +0100

#1333931 — [PATCH 4.3 058/200] mtd: ubi: dont leak e if schedule_erase() fails

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-15 01:10 +0100
Subject[PATCH 4.3 058/200] mtd: ubi: dont leak e if schedule_erase() fails
Message-ID<r2eTN-1DD-37@gated-at.bofh.it>
4.3-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Siewior <bigeasy@linutronix.de>

commit 6b238de189f69dc77d660d4cce62eed15547f4c3 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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/ubi/wl.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1060,6 +1060,7 @@ static int __erase_worker(struct ubi_dev
 		/* 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;
 		}

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web