summaryrefslogtreecommitdiff
path: root/drivers/md/persistent-data/dm-transaction-manager.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2012-07-03 15:55:33 +0400
committerAlasdair G Kergon <agk@redhat.com>2012-07-03 15:55:33 +0400
commit25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f (patch)
treeb25b921b508994e51c7d2f03fe9ca1a055a59e77 /drivers/md/persistent-data/dm-transaction-manager.c
parent0d200aefd4ac51787b6b80de1bb7ce93bccd59f6 (diff)
downloadlinux-25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f.tar.xz
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 <snitzer@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-transaction-manager.c')
-rw-r--r--drivers/md/persistent-data/dm-transaction-manager.c3
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 400fe144c0cd..02bf78e9d10d 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);