HID: lenovo: Don't use stack variables for DMA buffers
authorJosh Boyer <jwboyer@fedoraproject.org>
Mon, 28 Mar 2016 13:22:14 +0000 (09:22 -0400)
committerJiri Kosina <jkosina@suse.cz>
Tue, 29 Mar 2016 13:39:36 +0000 (15:39 +0200)
commitea36ae09105b7688225c02d33f1f3213299360f6
tree0f26b91db057dc2fcc58acbeb327398d7ed250c6
parent972e6a993f278b416a8ee3ec65475724fc36feb2
HID: lenovo: Don't use stack variables for DMA buffers

The lenovo_send_cmd_cptkbd function uses a stack variable to submit
commands via hid_hw_raw_request.  Eventually this gets to the
usb_hcd_map_urb_for_dma function, which causes a warning to be thrown
if the CONFIG_DMA_API_DEBUG option is enabled.

Fix this by allocating a temporary buffer instead.

[jkosina@suse.cz: no need to NULL-initialize buf, spotted by Benjamin]
Reported-by: lejeczek <peljasz@yahoo.co.uk>
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-lenovo.c