From: K. Y. Srinivasan Date: Tue, 27 Dec 2011 21:49:37 +0000 (-0800) Subject: Drivers:hv: Fix a bug in vmbus_driver_unregister() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8f257a142fc3868d69de3f996b95d7bdbc509560;p=linux-beck.git Drivers:hv: Fix a bug in vmbus_driver_unregister() The function vmbus_exists() was introduced recently to deal with cases where the vmbus driver failed to initialize and yet other Hyper-V drivers attempted to register with the vmbus bus driver. This patch introduced a bug where vmbus_driver_unregister() would fail to unregister the driver. This patch fixes the problem. Signed-off-by: K. Y. Srinivasan Signed-off-by: Fuzhou Chen Cc: Sasha Levin Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index c3875f72b5bf..a220e5746d67 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -627,10 +627,7 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver) pr_info("unregistering driver %s\n", hv_driver->name); if (!vmbus_exists()) - return; - - driver_unregister(&hv_driver->driver); - + driver_unregister(&hv_driver->driver); } EXPORT_SYMBOL_GPL(vmbus_driver_unregister);