summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPiotr Wilczek <p.wilczek@samsung.com>2013-06-26 08:22:05 +0200
committerMarek Vasut <marex@denx.de>2013-06-30 18:41:07 +0200
commit7f3cf4060fe8e93d785581ea2047929c1cb15a18 (patch)
treee2fcd675dbaa72ce5c8ed7769d85d2cfb9a905c9 /drivers/usb
parente7e75c70c5d5d3365606c4a76adb7ff4822d2f75 (diff)
downloadu-boot-imx-7f3cf4060fe8e93d785581ea2047929c1cb15a18.zip
u-boot-imx-7f3cf4060fe8e93d785581ea2047929c1cb15a18.tar.gz
u-boot-imx-7f3cf4060fe8e93d785581ea2047929c1cb15a18.tar.bz2
drivers:usb: use get|put_unaligned_le16
This patch use get|put_unaligned_le16 to access structure data to avoid data abort on some ARM platforms. Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 45bc132..5b348d7 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -577,9 +577,9 @@ static int fsg_setup(struct usb_function *f,
{
struct fsg_dev *fsg = fsg_from_func(f);
struct usb_request *req = fsg->common->ep0req;
- u16 w_index = le16_to_cpu(ctrl->wIndex);
- u16 w_value = le16_to_cpu(ctrl->wValue);
- u16 w_length = le16_to_cpu(ctrl->wLength);
+ u16 w_index = get_unaligned_le16(&ctrl->wIndex);
+ u16 w_value = get_unaligned_le16(&ctrl->wValue);
+ u16 w_length = get_unaligned_le16(&ctrl->wLength);
if (!fsg_is_set(fsg->common))
return -EOPNOTSUPP;
@@ -617,7 +617,7 @@ static int fsg_setup(struct usb_function *f,
"unknown class-specific control req "
"%02x.%02x v%04x i%04x l%u\n",
ctrl->bRequestType, ctrl->bRequest,
- le16_to_cpu(ctrl->wValue), w_index, w_length);
+ get_unaligned_le16(&ctrl->wValue), w_index, w_length);
return -EOPNOTSUPP;
}