HID: logitech: don't use stack based dj_report structures
authorMarc Dionne <marc.c.dionne@gmail.com>
Fri, 1 Jun 2012 22:12:14 +0000 (18:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 23:02:15 +0000 (16:02 -0700)
commit761dae91fdfa90c58254f9367ff05a37281855c3
treeb8360ac049b4fc1db35c4f666b84903740ce2d1a
parent359c6340faa39167666c0e9b9f44ad54a521c409
HID: logitech: don't use stack based dj_report structures

commit d8dc3494f77a5cc3b274bae36f7e74e85cf8a407 upstream.

On a system with a logitech wireless keyboard/mouse and DMA-API debugging
enabled, this warning appears at boot:

kernel: WARNING: at lib/dma-debug.c:929 check_for_stack.part.12+0x70/0xa7()
kernel: Hardware name: MS-7593
kernel: uhci_hcd 0000:00:1d.1: DMA-API: device driver maps memory fromstack [addr=ffff8801b0079c29]

Make logi_dj_recv_query_paired_devices and logi_dj_recv_switch_to_dj_mode
use a structure allocated with kzalloc rather than a stack based one.

Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-logitech-dj.c