]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: undefined return value in spl_blk_load_image
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 6 Sep 2023 12:25:11 +0000 (14:25 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 9 Sep 2023 04:12:47 +0000 (06:12 +0200)
spl_blk_load_image() should not return an uninitialized value if
blk_get_devnum_by_uclass_id() fails.

Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs")
Reported-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
common/spl/spl_blk_fs.c

index eb6f526689641b839578f572461a2a3656e849d2..ea5d1a51d9fcaa9cbe0d6152d85088c93253305d 100644 (file)
@@ -53,7 +53,7 @@ int spl_blk_load_image(struct spl_image_info *spl_image,
        blk_desc = blk_get_devnum_by_uclass_id(uclass_id, devnum);
        if (!blk_desc) {
                printf("blk desc for %d %d not found\n", uclass_id, devnum);
-               goto out;
+               return -ENODEV;
        }
 
        blk_show_device(uclass_id, devnum);