aboutsummaryrefslogtreecommitdiffstats
path: root/usb/usb-ohci-hub-code-unaligned-access.patch
blob: 7bd2767a8061fd9337173879f428272ed7a85214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From davem@davemloft.net Wed Jun 21 22:26:19 2006
Date: Wed, 21 Jun 2006 22:26:09 -0700 (PDT)
From: David Miller <davem@davemloft.net>
Message-Id: <20060621.222609.07641180.davem@davemloft.net>
To: gregkh@suse.de
Subject: USB: OHCI hub code unaligned access


I noticed this while debugging something unrelated on
sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ohci-hub.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- gregkh-2.6.orig/drivers/usb/host/ohci-hub.c
+++ gregkh-2.6/drivers/usb/host/ohci-hub.c
@@ -581,14 +581,14 @@ static int ohci_hub_control (
 		break;
 	case GetHubStatus:
 		temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE);
-		*(__le32 *) buf = cpu_to_le32 (temp);
+		put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
 		break;
 	case GetPortStatus:
 		if (!wIndex || wIndex > ports)
 			goto error;
 		wIndex--;
 		temp = roothub_portstatus (ohci, wIndex);
-		*(__le32 *) buf = cpu_to_le32 (temp);
+		put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
 
 #ifndef	OHCI_VERBOSE_DEBUG
 	if (*(u16*)(buf+2))	/* only if wPortChange is interesting */