Skip to content

Commit 00204ae

Browse files
author
Mikulas Patocka
committed
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 <mpatocka@redhat.com> Cc: stable@vger.kernel.org
1 parent a8b8a12 commit 00204ae

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
@@ -5081,16 +5081,19 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
50815081

50825082
ic->recalc_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
50835083
if (!ic->recalc_bitmap) {
5084+
ti->error = "Could not allocate memory for bitmap";
50845085
r = -ENOMEM;
50855086
goto bad;
50865087
}
50875088
ic->may_write_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
50885089
if (!ic->may_write_bitmap) {
5090+
ti->error = "Could not allocate memory for bitmap";
50895091
r = -ENOMEM;
50905092
goto bad;
50915093
}
50925094
ic->bbs = kvmalloc_array(ic->n_bitmap_blocks, sizeof(struct bitmap_block_status), GFP_KERNEL);
50935095
if (!ic->bbs) {
5096+
ti->error = "Could not allocate memory for bitmap";
50945097
r = -ENOMEM;
50955098
goto bad;
50965099
}

0 commit comments

Comments
 (0)