Drivers:hv: Fix a bug in vmbus_driver_unregister()
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 27 Dec 2011 21:49:37 +0000 (13:49 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 5 Jan 2012 00:14:44 +0000 (16:14 -0800)
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 <kys@microsoft.com>
Signed-off-by: Fuzhou Chen <fuzhouch@microsoft.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hv/vmbus_drv.c

index c3875f72b5bfd0fe2d8cda46e425dd84554f6680..a220e5746d67df8922f7421b2ee0b174d6ae949b 100644 (file)
@@ -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);