Skip to content

Commit 3367393

Browse files
committed
dm: add missing unlock on in dm_keyslot_evict()
JIRA: https://issues.redhat.com/browse/RHEL-92761 Upstream Status: kernel/git/torvalds/linux.git commit 650266a Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Wed Apr 30 11:05:54 2025 +0300 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: stable@vger.kernel.org # v5.12+ Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
1 parent 108c3e1 commit 3367393

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
@@ -1178,7 +1178,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
11781178

11791179
t = dm_get_live_table(md, &srcu_idx);
11801180
if (!t)
1181-
return 0;
1181+
goto put_live_table;
11821182

11831183
for (unsigned int i = 0; i < t->num_targets; i++) {
11841184
struct dm_target *ti = dm_table_get_target(t, i);
@@ -1189,6 +1189,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
11891189
(void *)key);
11901190
}
11911191

1192+
put_live_table:
11921193
dm_put_live_table(md, srcu_idx);
11931194
return 0;
11941195
}

0 commit comments

Comments
 (0)