diff options
Diffstat (limited to 'drivers/md/persistent-data/dm-transaction-manager.c')
-rw-r--r-- | drivers/md/persistent-data/dm-transaction-manager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 400fe144c0cd..e5604b32d91f 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); | |||
138 | 138 | ||
139 | void dm_tm_destroy(struct dm_transaction_manager *tm) | 139 | void dm_tm_destroy(struct dm_transaction_manager *tm) |
140 | { | 140 | { |
141 | if (!tm->is_clone) | ||
142 | wipe_shadow_table(tm); | ||
143 | |||
141 | kfree(tm); | 144 | kfree(tm); |
142 | } | 145 | } |
143 | EXPORT_SYMBOL_GPL(dm_tm_destroy); | 146 | EXPORT_SYMBOL_GPL(dm_tm_destroy); |
@@ -344,8 +347,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm, | |||
344 | } | 347 | } |
345 | 348 | ||
346 | *sm = dm_sm_checker_create(inner); | 349 | *sm = dm_sm_checker_create(inner); |
347 | if (!*sm) | 350 | if (IS_ERR(*sm)) { |
351 | r = PTR_ERR(*sm); | ||
348 | goto bad2; | 352 | goto bad2; |
353 | } | ||
349 | 354 | ||
350 | } else { | 355 | } else { |
351 | r = dm_bm_write_lock(dm_tm_get_bm(*tm), sb_location, | 356 | r = dm_bm_write_lock(dm_tm_get_bm(*tm), sb_location, |
@@ -364,8 +369,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm, | |||
364 | } | 369 | } |
365 | 370 | ||
366 | *sm = dm_sm_checker_create(inner); | 371 | *sm = dm_sm_checker_create(inner); |
367 | if (!*sm) | 372 | if (IS_ERR(*sm)) { |
373 | r = PTR_ERR(*sm); | ||
368 | goto bad2; | 374 | goto bad2; |
375 | } | ||
369 | } | 376 | } |
370 | 377 | ||
371 | return 0; | 378 | return 0; |