diff options
author | Alan Stern | 2005-10-24 22:24:14 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2005-10-29 01:47:51 +0200 |
commit | 4f62efe67f077db17dad03a1d4c9665000a3eb45 (patch) | |
tree | 27f1837fd08ce3dccb94a88a5afef6eb1a5ed738 /drivers/usb/core/config.c | |
parent | [PATCH] USB: Fix maxpacket length for ep0 on root hubs (diff) | |
download | kernel-qcow2-linux-4f62efe67f077db17dad03a1d4c9665000a3eb45.tar.gz kernel-qcow2-linux-4f62efe67f077db17dad03a1d4c9665000a3eb45.tar.xz kernel-qcow2-linux-4f62efe67f077db17dad03a1d4c9665000a3eb45.zip |
[PATCH] usbcore: Fix handling of sysfs strings and other attributes
This patch (as592) makes a few small improvements to the way device
strings are handled, and it fixes some bugs in a couple of other sysfs
attribute routines. (Look at show_configuration_string() to see what I
mean.)
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r-- | drivers/usb/core/config.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 63f374e62db2..993019500cc3 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -112,8 +112,12 @@ void usb_release_interface_cache(struct kref *ref) struct usb_interface_cache *intfc = ref_to_usb_interface_cache(ref); int j; - for (j = 0; j < intfc->num_altsetting; j++) - kfree(intfc->altsetting[j].endpoint); + for (j = 0; j < intfc->num_altsetting; j++) { + struct usb_host_interface *alt = &intfc->altsetting[j]; + + kfree(alt->endpoint); + kfree(alt->string); + } kfree(intfc); } @@ -420,8 +424,6 @@ void usb_destroy_configuration(struct usb_device *dev) struct usb_host_config *cf = &dev->config[c]; kfree(cf->string); - cf->string = NULL; - for (i = 0; i < cf->desc.bNumInterfaces; i++) { if (cf->intf_cache[i]) kref_put(&cf->intf_cache[i]->ref, |