From: Dan Carpenter Date: Wed, 31 Jan 2024 07:09:52 +0000 (+0300) Subject: blk: host_dev: Fix error code in host_sb_attach_file() X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=e5e7d8bbcffb26f5ac9a8fab7909225f527e157d;p=u-boot.git blk: host_dev: Fix error code in host_sb_attach_file() 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 --- diff --git a/drivers/block/host_dev.c b/drivers/block/host_dev.c index 30c7415793..52313435a0 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;