Skip to content

Commit

Permalink
USB: fix Unaligned access in EHCI driver
Browse files Browse the repository at this point in the history
I get following warnings on spar64:
Kernel unaligned access at TPC[1000c9e4] ehci_hub_control+0x54c/0x68c [ehci_hcd]

Despite of the comment in the patched code, the type cast used there
does make unaligned access. The fix was made as it's done in
ohci-hub.c.

Signed-off-by: Max Dmitrichenko <dmitrmax@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Max Dmitrichenko authored and Greg Kroah-Hartman committed Mar 10, 2007
1 parent d8b2160 commit 6454365
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,7 @@ static int ehci_hub_control (
if (status & ~0xffff) /* only if wPortChange is interesting */
#endif
dbg_port (ehci, "GetStatus", wIndex + 1, temp);
// we "know" this alignment is good, caller used kmalloc()...
*((__le32 *) buf) = cpu_to_le32 (status);
put_unaligned(cpu_to_le32 (status), (__le32 *) buf);
break;
case SetHubFeature:
switch (wValue) {
Expand Down

0 comments on commit 6454365

Please sign in to comment.