From: Frieder Schrempf <[email protected]>

distro_rauc_scan_parts() only sets desc if the bootflow has a block
device, but then checks desc before scanning the slots. Without a
block device, that check reads an uninitialised pointer and may hand
it to fs_set_blk_dev_with_part() and part_get_info().

Initialise desc to NULL, so that a bootflow without a block device
finds no slot, as the check intends.

Fixes: f271b0627001 ("bootstd: rauc: Only scan all partitions instead of boot 
files")
Signed-off-by: Frieder Schrempf <[email protected]>
---
 boot/bootmeth_rauc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/bootmeth_rauc.c b/boot/bootmeth_rauc.c
index 844df7576bb..4a3f05103eb 100644
--- a/boot/bootmeth_rauc.c
+++ b/boot/bootmeth_rauc.c
@@ -95,7 +95,7 @@ static int distro_rauc_check(struct udevice *dev, struct 
bootflow_iter *iter)
 
 static int distro_rauc_scan_parts(struct bootflow *bflow)
 {
-       struct blk_desc *desc;
+       struct blk_desc *desc = NULL;
        struct distro_rauc_priv *priv;
        struct disk_partition fs_info;
        char *boot_order;

-- 
2.56.0

Reply via email to