All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "mtd: ubi: don't leak e if schedule_erase() fails" has been added to the 4.3-stable tree
@ 2016-02-13 23:03 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-13 23:03 UTC (permalink / raw)
  To: bigeasy, gregkh, richard; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

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

to the 4.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mtd-ubi-don-t-leak-e-if-schedule_erase-fails.patch
and it can be found in the queue-4.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 6b238de189f69dc77d660d4cce62eed15547f4c3 Mon Sep 17 00:00:00 2001
From: Sebastian Siewior <bigeasy@linutronix.de>
Date: Thu, 26 Nov 2015 21:23:49 +0100
Subject: mtd: ubi: don't leak e if schedule_erase() fails

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;
 		}


Patches currently in stable-queue which might be from bigeasy@linutronix.de are

queue-4.3/mtd-ubi-don-t-leak-e-if-schedule_erase-fails.patch
queue-4.3/mtd-ubi-fixup-error-correction-in-do_sync_erase.patch
queue-4.3/pci-host-mark-pcie-pci-msi-irq-cascade-handlers-as-irqf_no_thread.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-13 23:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-13 23:03 Patch "mtd: ubi: don't leak e if schedule_erase() fails" has been added to the 4.3-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.