Skip to content

Commit

Permalink
dm persistent data: fix shadow_info_leak on dm_tm_destroy
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
snitm authored and kergon committed Jul 3, 2012
1 parent 0d200ae commit 25d7cd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/persistent-data/dm-transaction-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 25d7cd6

Please sign in to comment.