[PATCH 1/4] bootstd: rauc: Fix segfault when cleaning up slots
Martin Schwan
m.schwan at phytec.de
Wed Aug 13 13:54:05 CEST 2025
Fix a segfault when cleaning up the slots from the private struct. This
fault was generated by accessing a member of a null pointer.
Signed-off-by: Martin Schwan <m.schwan at phytec.de>
---
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 cc6180221ed90934801ebd801a7bd1b3fc889aec..a27c85c4ff07b88fd67d6a542c622840245dd397 100644
--- a/boot/bootmeth_rauc.c
+++ b/boot/bootmeth_rauc.c
@@ -187,7 +187,7 @@ static int distro_rauc_read_bootflow(struct udevice *dev, struct bootflow *bflow
ret = distro_rauc_scan_parts(bflow);
if (ret < 0) {
- for (i = 0; priv->slots[i]->name; i++) {
+ for (i = 0; priv->slots[i]; i++) {
free(priv->slots[i]->name);
free(priv->slots[i]);
}
--
2.50.1
More information about the U-Boot
mailing list