diff options
author | Sean Anderson | 2023-11-08 11:48:33 -0500 |
---|---|---|
committer | Tom Rini | 2023-11-16 13:49:13 -0500 |
commit | 1e86296f7f1079b70c583a917d0c24cd02f77491 (patch) | |
tree | daaba337ccd5f32420a8b02b87dae017087851f2 /common/spl | |
parent | 5e6a112e1187ebc570b8befd1dd6eef3a64dec39 (diff) |
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 <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/spl')
-rw-r--r-- | common/spl/spl_blk_fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/spl/spl_blk_fs.c b/common/spl/spl_blk_fs.c index 63825d620d1..144c8a65b5d 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) { |