From def1820d25fa93cf5fca10bf45f22cdb11be41f2 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Wed, 13 Feb 2013 13:47:54 -0500 Subject: vme: add missing put_device() after device_register() fails put_device() must be called after device_register() fails, since device_register() always initializes the refcount on the device structure. Signed-off-by: Emilio G. Cota Signed-off-by: Greg Kroah-Hartman --- drivers/vme/vme.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c index 95a9f71..5e6c7d7 100644 --- a/drivers/vme/vme.c +++ b/drivers/vme/vme.c @@ -1376,6 +1376,7 @@ static int __vme_register_driver_bus(struct vme_driver *drv, return 0; err_reg: + put_device(&vdev->dev); kfree(vdev); err_devalloc: list_for_each_entry_safe(vdev, tmp, &drv->devices, drv_list) { -- cgit v1.1