diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2023-01-31 15:49:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-31 21:54:35 +0100 |
commit | 45bf39f8df7f05efb83b302c65ae3b9bc92b7065 (patch) | |
tree | 18ae9c594efe73bf020c4b80ddca0dacea382426 /drivers/usb/core/hub.h | |
parent | 49814e2c9c5776c7dc7cfd151aba15bd91804c3c (diff) | |
download | linux-45bf39f8df7f05efb83b302c65ae3b9bc92b7065.tar.gz linux-45bf39f8df7f05efb83b302c65ae3b9bc92b7065.tar.bz2 linux-45bf39f8df7f05efb83b302c65ae3b9bc92b7065.zip |
USB: core: Don't hold device lock while reading the "descriptors" sysfs file
Ever since commit 83e83ecb79a8 ("usb: core: get config and string
descriptors for unauthorized devices") was merged in 2013, there has
been no mechanism for reallocating the rawdescriptors buffers in
struct usb_device after the initial enumeration. Before that commit,
the buffers would be deallocated when a device was deauthorized and
reallocated when it was authorized and enumerated.
This means that the locking in the read_descriptors() routine is not
needed, since the buffers it reads will never be reallocated while the
routine is running. This locking can interfere with user programs
trying to read a hub's descriptors via sysfs while new child devices
of the hub are being initialized, since the hub is locked during this
procedure.
Since the locking in read_descriptors() hasn't been needed for over
nine years, we can remove it.
Reported-and-tested-by: Troels Liebe Bentsen <troels@connectedcars.dk>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: stable@vger.kernel.org
Link: https://lore.kernel.org/r/Y9l+wDTRbuZABzsE@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.h')
0 files changed, 0 insertions, 0 deletions