USB: Fixed bug in endpoint release function.

Error handling in usb_create_ep_files() is not correct unless
the minor number is freed in ep_device_release().

Signed-off-by: Sarah Bailey <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Sarah Bailey and committed by Greg Kroah-Hartman c07be136 684a0e70

+1 -1
+1 -1
drivers/usb/core/endpoint.c
··· 268 struct ep_device *ep_dev = to_ep_device(dev); 269 270 dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id); 271 kfree(ep_dev); 272 } 273 ··· 350 sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); 351 sysfs_remove_link(&ep_dev->dev.parent->kobj, name); 352 sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); 353 - endpoint_free_minor(ep_dev); 354 device_unregister(&ep_dev->dev); 355 endpoint->ep_dev = NULL; 356 destroy_endpoint_class();
··· 268 struct ep_device *ep_dev = to_ep_device(dev); 269 270 dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id); 271 + endpoint_free_minor(ep_dev); 272 kfree(ep_dev); 273 } 274 ··· 349 sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); 350 sysfs_remove_link(&ep_dev->dev.parent->kobj, name); 351 sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp); 352 device_unregister(&ep_dev->dev); 353 endpoint->ep_dev = NULL; 354 destroy_endpoint_class();