mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 08:31:03 +00:00
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>
This commit is contained in:
parent
e7e75c70c5
commit
7f3cf4060f
1 changed files with 4 additions and 4 deletions
|
@ -577,9 +577,9 @@ static int fsg_setup(struct usb_function *f,
|
||||||
{
|
{
|
||||||
struct fsg_dev *fsg = fsg_from_func(f);
|
struct fsg_dev *fsg = fsg_from_func(f);
|
||||||
struct usb_request *req = fsg->common->ep0req;
|
struct usb_request *req = fsg->common->ep0req;
|
||||||
u16 w_index = le16_to_cpu(ctrl->wIndex);
|
u16 w_index = get_unaligned_le16(&ctrl->wIndex);
|
||||||
u16 w_value = le16_to_cpu(ctrl->wValue);
|
u16 w_value = get_unaligned_le16(&ctrl->wValue);
|
||||||
u16 w_length = le16_to_cpu(ctrl->wLength);
|
u16 w_length = get_unaligned_le16(&ctrl->wLength);
|
||||||
|
|
||||||
if (!fsg_is_set(fsg->common))
|
if (!fsg_is_set(fsg->common))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
@ -617,7 +617,7 @@ static int fsg_setup(struct usb_function *f,
|
||||||
"unknown class-specific control req "
|
"unknown class-specific control req "
|
||||||
"%02x.%02x v%04x i%04x l%u\n",
|
"%02x.%02x v%04x i%04x l%u\n",
|
||||||
ctrl->bRequestType, ctrl->bRequest,
|
ctrl->bRequestType, ctrl->bRequest,
|
||||||
le16_to_cpu(ctrl->wValue), w_index, w_length);
|
get_unaligned_le16(&ctrl->wValue), w_index, w_length);
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue