aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-01-31 10:09:52 +0300
committerTom Rini <trini@konsulko.com>2024-02-06 16:31:07 -0500
commite5e7d8bbcffb26f5ac9a8fab7909225f527e157d (patch)
treee781dcc492d960106d9a9926b3261fec3cb0d602
parentc59720c5f4c592688d2899b352f446703c968666 (diff)
downloadu-boot-WIP/2024-02-06-assorted-fixes.zip
u-boot-WIP/2024-02-06-assorted-fixes.tar.gz
u-boot-WIP/2024-02-06-assorted-fixes.tar.bz2
blk: host_dev: Fix error code in host_sb_attach_file()WIP/2024-02-06-assorted-fixes
This error path should return -EINVAL instead of success. Fixes: e261fbf34785 ("blk: host_dev: Sanity check on the size of host backing file") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
-rw-r--r--drivers/block/host_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/host_dev.c b/drivers/block/host_dev.c
index 30c7415..5231343 100644
--- a/drivers/block/host_dev.c
+++ b/drivers/block/host_dev.c
@@ -61,6 +61,7 @@ static int host_sb_attach_file(struct udevice *dev, const char *filename)
if (size % desc->blksz) {
printf("The size of host backing file '%s' is not multiple of "
"the device block size\n", filename);
+ ret = -EINVAL;
goto err_fname;
}
desc->lba = size / desc->blksz;