From: Max Dmitrichenko Date: Mon, 5 Mar 2007 23:45:01 +0000 (+0300) Subject: USB: fix Unaligned access in EHCI driver X-Git-Tag: v2.6.21-rc4~54^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=64543652609fc1a2a816dc38ce4f56eddda9f9a5;p=linux-2.6-omap-h63xx.git USB: fix Unaligned access in EHCI driver 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 9af529d22b3..1813b7cac29 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -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) {