Browse Source

usb: core: endpoint: Fix error path

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>
Rahul Ruikar 15 years ago
parent
commit
7b3a766c7b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/core/endpoint.c

+ 1 - 1
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;
 }