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

    dm thin: fix memory leak in process_prepared_mapping error paths

to the 3.5-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:
     dm-thin-fix-memory-leak-in-process_prepared_mapping-error-paths.patch
and it can be found in the queue-3.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 905386f82d08f66726912f303f3e6605248c60a3 Mon Sep 17 00:00:00 2001
From: Joe Thornber <[email protected]>
Date: Fri, 27 Jul 2012 15:08:05 +0100
Subject: dm thin: fix memory leak in process_prepared_mapping error paths

From: Joe Thornber <[email protected]>

commit 905386f82d08f66726912f303f3e6605248c60a3 upstream.

Fix memory leak in process_prepared_mapping by always freeing
the dm_thin_new_mapping structs from the mapping_pool mempool on
the error paths.

Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/md/dm-thin.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -859,7 +859,7 @@ static void process_prepared_mapping(str
 
        if (m->err) {
                cell_error(m->cell);
-               return;
+               goto out;
        }
 
        /*
@@ -871,7 +871,7 @@ static void process_prepared_mapping(str
        if (r) {
                DMERR("dm_thin_insert_block() failed");
                cell_error(m->cell);
-               return;
+               goto out;
        }
 
        /*
@@ -886,6 +886,7 @@ static void process_prepared_mapping(str
        } else
                cell_defer(tc, m->cell, m->data_block);
 
+out:
        list_del(&m->list);
        mempool_free(m, tc->pool->mapping_pool);
 }


Patches currently in stable-queue which might be from [email protected] are

queue-3.5/dm-thin-fix-memory-leak-in-process_prepared_mapping-error-paths.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to