[PATCH] drivers/base/driver.c : driver_unregister

From: Arne Caspari
Date: Sat Dec 11 2004 - 13:56:23 EST


Hi all,

I think the meaning of this patch is obvious: In driver_unregister, the bus_remove_driver function call was called outside the driver unload semaphore which should obviously protect it.

/Arne

*** linux-2.6.9/drivers/base/driver.c Mon Oct 18 23:55:06 2004
--- kernel-source-2.6.9/drivers/base/driver.c Sat Dec 11 10:59:59 2004
***************
*** 106,113 ****

void driver_unregister(struct device_driver * drv)
{
- bus_remove_driver(drv);
down(&drv->unload_sem);
up(&drv->unload_sem);
}

--- 106,113 ----

void driver_unregister(struct device_driver * drv)
{
down(&drv->unload_sem);
+ bus_remove_driver(drv);
up(&drv->unload_sem);
}