Skip to content

Commit

Permalink
USB: fix sign-extension bug in the hub driver
Browse files Browse the repository at this point in the history
This patch (as1646) fixes a long-standing bug in the USB hub driver.
Upon conversion from char to unsigned long, the bytes in the status
buffer are subject to unwanted sign extension.  The bytes should be
declared as u8 rather than char, to prevent this.

This effects of this bug are minimal.  The hub driver may end up doing
a little unnecessary extra work because it thinks events have occurred
on some ports when they really haven't.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jan 24, 2013
1 parent 3171fca commit bdb6bc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/core/hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct usb_hub {
struct urb *urb; /* for interrupt polling pipe */

/* buffer for urb ... with extra space in case of babble */
char (*buffer)[8];
u8 (*buffer)[8];
union {
struct usb_hub_status hub;
struct usb_port_status port;
Expand Down

0 comments on commit bdb6bc0

Please sign in to comment.