From: Rahul Ruikar Date: Thu, 7 Oct 2010 04:01:12 +0000 (+0530) Subject: usb: core: endpoint: Fix error path X-Git-Tag: upstream/snapshot3+hdmi~12696^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b3a766c7b9bce07875098cb68642df2b8f0b152;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 3788e73..9da2505 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; }