summaryrefslogtreecommitdiff
path: root/common/usb_kbd.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-20 16:51:26 +0200
committerMarek Vasut <marex@denx.de>2014-10-06 14:50:42 +0200
commit9b2393812e2b844919ac601b893e6210d5eb6e2c (patch)
tree46231b8b77cb50af622b9249d0857d8463a4a293 /common/usb_kbd.c
parent36b73109c49c1359a5fcc790c00717cb27468c12 (diff)
usb: kbd: Fix unaligned buffer usage in usb_kbd_setled()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'common/usb_kbd.c')
-rw-r--r--common/usb_kbd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index c34fd5c786..87f4125a9f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -170,11 +170,12 @@ static void usb_kbd_setled(struct usb_device *dev)
{
struct usb_interface *iface = &dev->config.if_desc[0];
struct usb_kbd_pdata *data = dev->privptr;
- uint32_t leds = data->flags & USB_KBD_LEDMASK;
+ ALLOC_ALIGN_BUFFER(uint32_t, leds, 1, USB_DMA_MINALIGN);
+ *leds = data->flags & USB_KBD_LEDMASK;
usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
- 0x200, iface->desc.bInterfaceNumber, (void *)&leds, 1, 0);
+ 0x200, iface->desc.bInterfaceNumber, leds, 1, 0);
}
#define CAPITAL_MASK 0x20