mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
dm-integrity: set ti->error on memory allocation failure
commit 00204ae3d6712ee053353920e3ce2b00c35ef75b upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
841ca9e922
commit
7958b71d8b
@@ -4594,16 +4594,19 @@ try_smaller_buffer:
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user