From: Alan Stern Date: Thu, 24 Jan 2013 20:04:13 +0000 (-0500) Subject: USB: fix sign-extension bug in the hub driver X-Git-Tag: v3.9-rc1~126^2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdb6bc06f7d694652c12fb8779bb031c2f220823;p=platform%2Fkernel%2Flinux-3.10.git 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: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index d16a7c9..c472058 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -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;