From: Sean Anderson Date: Wed, 8 Nov 2023 16:48:33 +0000 (-0500) Subject: spl: blk_fs: Fix uninitialized return value when we can't get a blk_desc X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=1e86296f7f1079b70c583a917d0c24cd02f77491;p=u-boot.git spl: blk_fs: Fix uninitialized return value when we can't get a blk_desc Initialize ret to avoid returning garbage if blk_get_devnum_by_uclass_id fails. Fixes: 8ce6a2e1757 ("spl: blk: Support loading images from fs") Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- diff --git a/common/spl/spl_blk_fs.c b/common/spl/spl_blk_fs.c index 63825d620d..144c8a65b5 100644 --- a/common/spl/spl_blk_fs.c +++ b/common/spl/spl_blk_fs.c @@ -50,7 +50,7 @@ int spl_blk_load_image(struct spl_image_info *spl_image, struct blk_desc *blk_desc; loff_t actlen, filesize; struct blk_dev dev; - int ret; + int ret = -ENODEV; blk_desc = blk_get_devnum_by_uclass_id(uclass_id, devnum); if (!blk_desc) {