mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
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
This commit is contained in:
parent
a8b8a126c8
commit
00204ae3d6
|
|
@ -5081,16 +5081,19 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
|
|||
|
||||
ic->recalc_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
|
||||
if (!ic->recalc_bitmap) {
|
||||
ti->error = "Could not allocate memory for bitmap";
|
||||
r = -ENOMEM;
|
||||
goto bad;
|
||||
}
|
||||
ic->may_write_bitmap = dm_integrity_alloc_page_list(n_bitmap_pages);
|
||||
if (!ic->may_write_bitmap) {
|
||||
ti->error = "Could not allocate memory for bitmap";
|
||||
r = -ENOMEM;
|
||||
goto bad;
|
||||
}
|
||||
ic->bbs = kvmalloc_array(ic->n_bitmap_blocks, sizeof(struct bitmap_block_status), GFP_KERNEL);
|
||||
if (!ic->bbs) {
|
||||
ti->error = "Could not allocate memory for bitmap";
|
||||
r = -ENOMEM;
|
||||
goto bad;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user