[PATCH 1/1] spl: undefined return value in spl_blk_load_image

Xavier Drudis Ferran xdrudis at tinet.cat
Wed Sep 6 19:55:58 CEST 2023


El Wed, Sep 06, 2023 at 02:25:11PM +0200, Heinrich Schuchardt deia:
> 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 at tinet.cat>

FWIW:

Reviewed-by:  Xavier Drudis Ferran <xdrudis at tinet.cat>


> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  common/spl/spl_blk_fs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_blk_fs.c b/common/spl/spl_blk_fs.c
> index eb6f526689..ea5d1a51d9 100644
> --- a/common/spl/spl_blk_fs.c
> +++ b/common/spl/spl_blk_fs.c
> @@ -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);
> -- 
> 2.40.1
> 


More information about the U-Boot mailing list