]> git.baikalelectronics.ru Git - kernel.git/commit
HID: avoid '\0' in hid debugfs events file
authorBruno Prémont <bonbons@linux-vserver.org>
Mon, 15 Mar 2010 18:00:27 +0000 (19:00 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 16 Mar 2010 12:36:01 +0000 (13:36 +0100)
commit5261813a289238266c97d8e389f6e7a877d2bc89
tree5c10ca02dfff40acb1dc5c1915669a8c31e818a9
parentd11bb1e23ba9acfe5dc9aed48ffbb11f40b3bf4b
HID: avoid '\0' in hid debugfs events file

When dumping /sys/kernel/debug/hid/$device/events '\0' characters show up
(invisible if cat to console but shown by less or while looking at a dump
 file).  These are due to hid_debug_event() adding strlen()+1 bytes to the ring
buffer (e.g. including the trailing '\0').  Any roll-over causes a '\0' as well
as hid_debug_event() handles the ring buffers with HID_DEBUG_BUFSIZE-1 size
while hid_debug_events_read() handles it with full HID_DEBUG_BUFSIZE size.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-debug.c