usb: core: endpoint: Fix error path
authorRahul Ruikar <rahul.ruikar@gmail.com>
Thu, 7 Oct 2010 04:01:12 +0000 (09:31 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:22:06 +0000 (10:22 -0700)
In function usb_create_ep_devs()
call put_device() when device_register() fails.

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/endpoint.c

index 3788e738e265058ec164368a06fbf6897305aa51..9da250563027630330d92831ac0adbe428feb1cb 100644 (file)
@@ -202,7 +202,7 @@ int usb_create_ep_devs(struct device *parent,
        return retval;
 
 error_register:
-       kfree(ep_dev);
+       put_device(&ep_dev->dev);
 exit:
        return retval;
 }