[27/49] Drivers:hv: Fix a bug in vmbus_driver_unregister()

From: Greg KH
Date: Tue Jan 10 2012 - 18:02:51 EST


3.2-stable review patch. If anyone has any objections, please let me know.

------------------

From: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>

commit 8f257a142fc3868d69de3f996b95d7bdbc509560 upstream.

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@xxxxxxxxxxxxx>
Signed-off-by: Fuzhou Chen <fuzhouch@xxxxxxxxxxxxx>
Cc: Sasha Levin <levinsasha928@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/hv/vmbus_drv.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -627,10 +627,7 @@ void vmbus_driver_unregister(struct hv_d
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);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/