]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
blk: host_dev: Fix error code in host_sb_attach_file()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 31 Jan 2024 07:09:52 +0000 (10:09 +0300)
committerTom Rini <trini@konsulko.com>
Tue, 6 Feb 2024 21:31:07 +0000 (16:31 -0500)
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>
drivers/block/host_dev.c

index 30c74157934a53dfc81ce4159b49e59b2e9e6e39..52313435a0cb84b3b2b3b699506d519db35995be 100644 (file)
@@ -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;