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: 8ce6a2e175 ("spl: blk: Support loading images from fs")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Sean Anderson 2023-11-08 11:48:33 -05:00 committed by Tom Rini
parent 5e6a112e11
commit 1e86296f7f

View file

@ -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) {