summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2025-11-17 21:42:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:08:23 +0900
commit295b169a10186c3d8e5529ed8e544f7993c6f6e6 (patch)
treef2bad6c8d99bd79ac9b1e000ab93641aeddd8101 /drivers
parent6dfc11c4df38a218e77684b1e72c4f7252069d6a (diff)
downloadlinux-295b169a10186c3d8e5529ed8e544f7993c6f6e6.tar.gz
linux-295b169a10186c3d8e5529ed8e544f7993c6f6e6.tar.bz2
linux-295b169a10186c3d8e5529ed8e544f7993c6f6e6.zip
dm-verity: fix unreliable memory allocation
commit fe680d8c747f4e676ac835c8c7fb0f287cd98758 upstream. GFP_NOWAIT allocation may fail anytime. It needs to be changed to GFP_NOIO. There's no need to handle an error because mempool_alloc with GFP_NOIO can't fail. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-verity-fec.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c
index 442437e4e03b..1a23d3ebf098 100644
--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -314,11 +314,7 @@ static int fec_alloc_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio)
if (fio->bufs[n])
continue;
- fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT);
- if (unlikely(!fio->bufs[n])) {
- DMERR("failed to allocate FEC buffer");
- return -ENOMEM;
- }
+ fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOIO);
}
/* try to allocate the maximum number of buffers */