소스 검색

[PATCH] 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>
David Miller 19 년 전
부모
커밋
92164c5dd1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      drivers/usb/host/ohci-hub.c

+ 2 - 2
drivers/usb/host/ohci-hub.c

@@ -581,14 +581,14 @@ static int ohci_hub_control (
 		break;
 		break;
 	case GetHubStatus:
 	case GetHubStatus:
 		temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE);
 		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;
 		break;
 	case GetPortStatus:
 	case GetPortStatus:
 		if (!wIndex || wIndex > ports)
 		if (!wIndex || wIndex > ports)
 			goto error;
 			goto error;
 		wIndex--;
 		wIndex--;
 		temp = roothub_portstatus (ohci, wIndex);
 		temp = roothub_portstatus (ohci, wIndex);
-		*(__le32 *) buf = cpu_to_le32 (temp);
+		put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
 
 
 #ifndef	OHCI_VERBOSE_DEBUG
 #ifndef	OHCI_VERBOSE_DEBUG
 	if (*(u16*)(buf+2))	/* only if wPortChange is interesting */
 	if (*(u16*)(buf+2))	/* only if wPortChange is interesting */