[PATCH 11/14] staging: hv: fix device_register() error handling

From: Vasiliy Kulikov
Date: Sun Sep 19 2010 - 08:55:24 EST


If device_register() fails then call put_device().
See comment to device_register.

Signed-off-by: Vasiliy Kulikov <segooon@xxxxxxxxx>
---
compile tested.

drivers/staging/hv/vmbus_drv.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index ad29887..255e4b2 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -345,6 +345,7 @@ static int vmbus_bus_init(int (*drv_init)(struct hv_driver *drv))
DPRINT_ERR(VMBUS_DRV,
"ERROR - Unable to register vmbus root device");

+ put_device(&dev_ctx->device);
free_irq(vmbus_irq, NULL);
bus_unregister(&vmbus_drv_ctx->bus);

--
1.7.0.4

--
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/