From 7b3a766c7b9bce07875098cb68642df2b8f0b152 Mon Sep 17 00:00:00 2001 From: Rahul Ruikar Date: Thu, 7 Oct 2010 09:31:12 +0530 Subject: [PATCH] usb: core: endpoint: Fix error path In function usb_create_ep_devs() call put_device() when device_register() fails. Signed-off-by: Rahul Ruikar Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/endpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 3788e738e265..9da250563027 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -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; }