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:45:34 +0200
commit7958b71d8baaf5a1afaeb34130e6da3172e7401b (patch)
treea10eace061aeeaba6e83b1e4b087810bf06e4cc8 /drivers/md
parent841ca9e9224cf7624f846610652a6da3e7fe7b0a (diff)
downloadlinux-7958b71d8baaf5a1afaeb34130e6da3172e7401b.tar.gz
linux-7958b71d8baaf5a1afaeb34130e6da3172e7401b.tar.bz2
linux-7958b71d8baaf5a1afaeb34130e6da3172e7401b.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 a36dd749c688..eb2b44f4a61f 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -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;
}