HID: hiddev: Use vzalloc to allocate hiddev_list
authorHavard Skinnemoen <hskinnemoen@google.com>
Thu, 26 Apr 2012 18:16:00 +0000 (11:16 -0700)
committerJiri Kosina <jkosina@suse.cz>
Fri, 27 Apr 2012 14:03:40 +0000 (16:03 +0200)
commitd4f0e4daf0d867f80c78ca4f9ac03a562e229e72
tree2a370bb114f8d4e1a66a69f7d3dcdcef3cc3b716
parent9f1f463ae5d8597fe2b4ffc73051616c47ac1924
HID: hiddev: Use vzalloc to allocate hiddev_list

Everytime a HID device is opened, a new hiddev_list is allocated with
kzalloc. This requires 64KB of physically contiguous memory, which could
easily push a heavily loaded system over the edge.

Allocating the same amount of memory with vmalloc shouldn't be nearly as
demanding, so let's do that instead. The memory isn't used for DMA and
doesn't look particularly performance sensitive, so this should be safe.

Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hiddev.c