commit: 25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f
From: Mike Snitzer <[email protected]>
Date: Tue, 3 Jul 2012 12:55:33 +0100
Subject: dm persistent data: fix shadow_info_leak on dm_tm_destroy

Cleanup the shadow table before destroying the transaction manager.

Reference: leak was identified with kmemleak when running
test_discard_random_sectors in the thinp-test-suite.

Signed-off-by: Mike Snitzer <[email protected]>
Cc: [email protected]
Signed-off-by: Alasdair G Kergon <[email protected]>
---
 .../md/persistent-data/dm-transaction-manager.c    |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/md/persistent-data/dm-transaction-manager.c 
b/drivers/md/persistent-data/dm-transaction-manager.c
index 400fe14..02bf78e 100644
--- a/drivers/md/persistent-data/dm-transaction-manager.c
+++ b/drivers/md/persistent-data/dm-transaction-manager.c
@@ -138,6 +138,9 @@ EXPORT_SYMBOL_GPL(dm_tm_create_non_blocking_clone);
 
 void dm_tm_destroy(struct dm_transaction_manager *tm)
 {
+       if (!tm->is_clone)
+               wipe_shadow_table(tm);
+
        kfree(tm);
 }
 EXPORT_SYMBOL_GPL(dm_tm_destroy);
-- 
1.7.3.4
--
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