summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2025-02-10 16:14:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 10:43:44 +0200
commit5162ecc2d99e5d60d0cd214cdbc023ad5592d211 (patch)
tree905c1c14998a90fe67405618f992d3bda168b0f5 /drivers/md
parente89228ddd52aad892663e1c937a7c0e015876538 (diff)
downloadlinux-5162ecc2d99e5d60d0cd214cdbc023ad5592d211.tar.gz
linux-5162ecc2d99e5d60d0cd214cdbc023ad5592d211.tar.bz2
linux-5162ecc2d99e5d60d0cd214cdbc023ad5592d211.zip
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-integrity.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index e0ffac93f900..c1f1f4ad608d 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -4546,16 +4546,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;
}