Re: [syzbot] [usb?] general protection fault in bus_remove_device

From: Edward Adam Davis

Date: Thu Aug 20 2026 - 01:31:17 EST


#syz test

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 60c005223844..4154b44990b2 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1354,7 +1354,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
device_unbind_cleanup(dev);
device_links_driver_cleanup(dev);

- klist_remove(&dev->p->knode_driver);
+ if (device_is_bound(dev))
+ klist_remove(&dev->p->knode_driver);
device_pm_check_callbacks(dev);

bus_notify(dev, BUS_NOTIFY_UNBOUND_DRIVER);