Skip to content

Commit 611c579

Browse files
committed
dm-integrity: set ti->error on memory allocation failure
JIRA: https://issues.redhat.com/browse/RHEL-92761 Upstream Status: kernel/git/torvalds/linux.git commit 00204ae Author: Mikulas Patocka <[email protected]> Date: Mon Feb 10 16:14:22 2025 +0100 dm-integrity: set ti->error on memory allocation failure The dm-integrity target didn't set the error string when memory allocation failed. This patch fixes it. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Signed-off-by: Benjamin Marzinski <[email protected]>
1 parent 06792db commit 611c579

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/md/dm-integrity.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,16 +5084,19 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
50845084

50855085
ic->recalc_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
50865086
if (!ic->recalc_bitmap) {
5087+
ti->error = "Could not allocate memory for bitmap";
50875088
r = -ENOMEM;
50885089
goto bad;
50895090
}
50905091
ic->may_write_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
50915092
if (!ic->may_write_bitmap) {
5093+
ti->error = "Could not allocate memory for bitmap";
50925094
r = -ENOMEM;
50935095
goto bad;
50945096
}
50955097
ic->bbs = kvmalloc_array(ic->n_bitmap_blocks, sizeof(struct bitmap_block_status), GFP_KERNEL);
50965098
if (!ic->bbs) {
5099+
ti->error = "Could not allocate memory for bitmap";
50975100
r = -ENOMEM;
50985101
goto bad;
50995102
}

0 commit comments

Comments
 (0)