]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dm persistent data: fix shadow_info_leak on dm_tm_destroy
authorMike Snitzer <snitzer@redhat.com>
Tue, 3 Jul 2012 11:55:33 +0000 (12:55 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:07 +0000 (04:32 +0100)
commit 25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f upstream.

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 <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/persistent-data/dm-transaction-manager.c

index 6f8d38747d7f438294fca80e24a3e3a61441dda1..e5902d1f8c14afc0c390f5ff0bd32e43e337933b 100644 (file)
@@ -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);