[PATCH 02/19] commands: devunbind: don't poison the active list entry
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Oct 28 02:14:36 PDT 2026
From: Ahmad Fatoum <a.fatoum at barebox.org>
devunbind removes the device from the active list with list_del(),
which poisons the entry, so a later devunbind -f crashes when
unregister_device() removes it a second time. Use list_del_init()
instead.
Fixes: 90244aef7299 ("commands: add new devunbind debugging command")
Assisted-by: Claude:opus-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
commands/devunbind.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/devunbind.c b/commands/devunbind.c
index 76dd0b715e6e..9fd7483210f3 100644
--- a/commands/devunbind.c
+++ b/commands/devunbind.c
@@ -65,7 +65,7 @@ static int do_devunbind(int argc, char *argv[])
}
dev->driver = NULL;
- list_del(&dev->active);
+ list_del_init(&dev->active);
}
return ret;
--
2.47.3
More information about the barebox
mailing list