Skip to content

Commit

Permalink
USB: Fixed bug in endpoint release function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sarah Bailey authored and Greg Kroah-Hartman committed Jan 5, 2007
1 parent 684a0e7 commit c07be13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/core/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ static void ep_device_release(struct device *dev)
struct ep_device *ep_dev = to_ep_device(dev);

dev_dbg(dev, "%s called for %s\n", __FUNCTION__, dev->bus_id);
endpoint_free_minor(ep_dev);
kfree(ep_dev);
}

Expand Down Expand Up @@ -349,7 +350,6 @@ void usb_remove_ep_files(struct usb_host_endpoint *endpoint)
sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress);
sysfs_remove_link(&ep_dev->dev.parent->kobj, name);
sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);
endpoint_free_minor(ep_dev);
device_unregister(&ep_dev->dev);
endpoint->ep_dev = NULL;
destroy_endpoint_class();
Expand Down

0 comments on commit c07be13

Please sign in to comment.