From 1f84ac10f8a3b8c67bbe387deaae7f0dafcb2a52 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 22 Apr 2025 17:46:09 -0400 Subject: [PATCH] bio_add_page is now __must_check The return type always has been int, so, we just need to add return value checking and do something with it. We could return -ENOMEM here as well, either way it'll fall all the way through no matter what. This is since v6.4-rc2-100-g83f2caaaf9cb. Signed-off-by: Auke Kok --- kmod/src/block.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kmod/src/block.c b/kmod/src/block.c index e0ac6590..81c43836 100644 --- a/kmod/src/block.c +++ b/kmod/src/block.c @@ -1239,7 +1239,12 @@ static int sm_block_io(struct super_block *sb, struct block_device *bdev, blk_op bio->bi_iter.bi_sector = blkno << (SCOUTFS_BLOCK_SM_SHIFT - 9); bio->bi_end_io = sm_block_bio_end_io; bio->bi_private = &sbc; - bio_add_page(bio, page, SCOUTFS_BLOCK_SM_SIZE, 0); + ret = bio_add_page(bio, page, SCOUTFS_BLOCK_SM_SIZE, 0); + if (ret != SCOUTFS_BLOCK_SM_SIZE) { + bio_put(bio); + ret = -EFAULT; + goto out; + } init_completion(&sbc.comp); sbc.err = 0;