Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39816
b: refs/heads/master
c: d5477c1
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 17, 2006
1 parent dea6ae2 commit b09c069
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c40fd5ea565587c05b0e2c49c02cad2c35fd85c6
refs/heads/master: d5477c11111467e19787f00d3cab20fb48c2699e
18 changes: 8 additions & 10 deletions trunk/drivers/usb/core/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int usb_create_ep_files(struct device *parent,
ep_dev = kzalloc(sizeof(*ep_dev), GFP_KERNEL);
if (!ep_dev) {
retval = -ENOMEM;
goto exit;
goto error_alloc;
}

/* fun calculation to determine the minor of this endpoint */
Expand All @@ -241,33 +241,31 @@ int usb_create_ep_files(struct device *parent,

retval = device_register(&ep_dev->dev);
if (retval)
goto error;
goto error_register;
retval = sysfs_create_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);
if (retval)
goto error_group;

endpoint->ep_dev = ep_dev;

/* create the symlink to the old-style "ep_XX" directory */
sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress);
retval = sysfs_create_link(&parent->kobj,
&endpoint->ep_dev->dev.kobj, name);
retval = sysfs_create_link(&parent->kobj, &ep_dev->dev.kobj, name);
if (retval)
goto error_link;
exit:
endpoint->ep_dev = ep_dev;
return retval;

error_link:
sysfs_remove_group(&ep_dev->dev.kobj, &ep_dev_attr_grp);

error_group:
device_unregister(&ep_dev->dev);
endpoint->ep_dev = NULL;
destroy_endpoint_class();
return retval;
error:

error_register:
kfree(ep_dev);
error_alloc:
destroy_endpoint_class();
exit:
return retval;
}

Expand Down

0 comments on commit b09c069

Please sign in to comment.