Skip to content

Commit 650266a

Browse files
Dan CarpenterMikulas Patocka
Dan Carpenter
authored and
Mikulas Patocka
committed
dm: add missing unlock on in dm_keyslot_evict()
We need to call dm_put_live_table() even if dm_get_live_table() returns NULL. Fixes: 9355a9e ("dm: support key eviction from keyslot managers of underlying devices") Cc: [email protected] # v5.12+ Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 5a2a6c4 commit 650266a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/md/dm-table.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
11731173

11741174
t = dm_get_live_table(md, &srcu_idx);
11751175
if (!t)
1176-
return 0;
1176+
goto put_live_table;
11771177

11781178
for (unsigned int i = 0; i < t->num_targets; i++) {
11791179
struct dm_target *ti = dm_table_get_target(t, i);
@@ -1184,6 +1184,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
11841184
(void *)key);
11851185
}
11861186

1187+
put_live_table:
11871188
dm_put_live_table(md, srcu_idx);
11881189
return 0;
11891190
}

0 commit comments

Comments
 (0)