Skip to contentSkip to conversation

staging: hv: fix device_register() error handling

PATCH Applied Vasiliy Kulikov 1 participant 1 message Sep 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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

---
compile tested.

 drivers/staging/hv/vmbus_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/hv/vmbus_drv.c +1 -0
index ad29887..255e4b2 100644
@@ -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);
 
Signature · 1 line
1.7.0.4