]> git.baikalelectronics.ru Git - kernel.git/commit
HID: huion: Use allocated buffer for DMA
authorNikolai Kondrashov <spbnick@gmail.com>
Mon, 11 Aug 2014 17:45:32 +0000 (20:45 +0300)
committerJiri Kosina <jkosina@suse.cz>
Tue, 12 Aug 2014 10:44:59 +0000 (12:44 +0200)
commitd50198ee7d15fc1c749725cd5c1cfc2716797b08
tree9e1e243f2584375c902ed64c23f59d03e42cadd3
parent4322c4e3abd586bf6c25f93b0e3c3e11efb806de
HID: huion: Use allocated buffer for DMA

Allocate a buffer with kmalloc for receiving the parameters string
descriptor with usb_control_msg, instead of using a buffer on the stack,
as the latter is unsafe. Use an enum for indices into the buffer to
ensure the buffer size if sufficient.

This fixes the static checker error "doing dma on the stack (buf)".

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-huion.c