From stern@rowland.harvard.edu Fri Mar 31 08:52:32 2006 Date: Fri, 31 Mar 2006 11:52:25 -0500 (EST) From: Alan Stern To: Greg KH Subject: driver core: safely unbind drivers for devices not on a bus Message-ID: This patch (as667) changes the __device_release_driver() routine to prevent it from crashing when it runs across a device not on any bus. This seems logical, inasmuch as the corresponding bus_add_device() routine has an explicit check allowing it to accept such devices. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/base/dd.c +++ gregkh-2.6/drivers/base/dd.c @@ -209,7 +209,7 @@ static void __device_release_driver(stru sysfs_remove_link(&dev->kobj, "driver"); klist_remove(&dev->knode_driver); - if (dev->bus->remove) + if (dev->bus && dev->bus->remove) dev->bus->remove(dev); else if (drv->remove) drv->remove(dev);