Commit 25d7cd6f authored by Mike Snitzer's avatar Mike Snitzer Committed by Alasdair G Kergon

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: default avatarMike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 0d200aef
...@@ -138,6 +138,9 @@ EXPORT_SYMBOL_GPL(dm_tm_create_non_blocking_clone); ...@@ -138,6 +138,9 @@ EXPORT_SYMBOL_GPL(dm_tm_create_non_blocking_clone);
void dm_tm_destroy(struct dm_transaction_manager *tm) void dm_tm_destroy(struct dm_transaction_manager *tm)
{ {
if (!tm->is_clone)
wipe_shadow_table(tm);
kfree(tm); kfree(tm);
} }
EXPORT_SYMBOL_GPL(dm_tm_destroy); EXPORT_SYMBOL_GPL(dm_tm_destroy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment