Skip to content

Commit 1b8d278

Browse files
jthornbersnitm
authored andcommitted
dm btree remove: fix use after free in rebalance_children()
Move dm_tm_unlock() after dm_tm_dec(). Cc: [email protected] Signed-off-by: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 1360572 commit 1b8d278

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/persistent-data/dm-btree-remove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
423423

424424
memcpy(n, dm_block_data(child),
425425
dm_bm_block_size(dm_tm_get_bm(info->tm)));
426-
dm_tm_unlock(info->tm, child);
427426

428427
dm_tm_dec(info->tm, dm_block_location(child));
428+
dm_tm_unlock(info->tm, child);
429429
return 0;
430430
}
431431

0 commit comments

Comments
 (0)