From 12595e99e40ba4d0a08744e375f4e2144dc5acb6 Mon Sep 17 00:00:00 2001
From: Piotr Wilczek
Date: Wed, 10 Apr 2013 14:07:51 +0200
Subject: [PATCH] usb:composite: use memcpy to avoid unaligned access
This patch memcpy is used instead of an assignment to
avoid unaligned access execption on some ARM platforms.
Signed-off-by: Piotr Wilczek
Signed-off-by: Kyungmin Park
CC: Lukasz Majewski
Tested-by: Heiko Schocher
Acked-by: Heiko Schocher
---
drivers/usb/gadget/composite.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index f30778a163..f8677931b4 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -997,7 +997,8 @@ static int composite_bind(struct usb_gadget *gadget)
if (status < 0)
goto fail;
- cdev->desc = *composite->dev;
+ memcpy(&cdev->desc, composite->dev,
+ sizeof(struct usb_device_descriptor));
cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
debug("%s: ready\n", composite->name);
--
2.39.5