Skip to contentSkip to conversation

dm transaction manager: fix shadow_info leaks on dm_tm_destroy

PATCH New Mike Snitzer 1 participant 1 message Jun 19, 2012 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm transaction manager: fix shadow_info leaks 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.

---
 .../md/persistent-data/dm-transaction-manager.c    |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/md/persistent-data/dm-transaction-manager.c +3 -0
index 400fe14..02bf78e 100644
@@ -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);
Signature · 1 line
1.7.4.4