提交 bdb6bc06 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: fix sign-extension bug in the hub driver

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: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3171fcab
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册