From: Ahmad Fatoum <[email protected]>

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 <[email protected]>
---
 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


Reply via email to