Commit 63c32d4d authored by Patrick Mochel's avatar Patrick Mochel Committed by Patrick Mochel

Don't reference driver after you set pointer to NULL in device_detach

parent cec06af8
......@@ -103,14 +103,14 @@ static void device_detach(struct device * dev)
list_del_init(&dev->driver_list);
write_unlock(&dev->driver->lock);
lock_device(dev);
dev->driver = NULL;
unlock_device(dev);
/* detach from driver */
if (dev->driver->remove)
dev->driver->remove(dev);
put_driver(dev->driver);
lock_device(dev);
dev->driver = NULL;
unlock_device(dev);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment