spl: undefined return value in spl_blk_load_image

spl_blk_load_image() should not return an uninitialized value if
blk_get_devnum_by_uclass_id() fails.

Fixes: 8ce6a2e175 ("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>
This commit is contained in:
Heinrich Schuchardt 2023-09-06 14:25:11 +02:00
parent c0c08be546
commit 323e91a183

View 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);