]> git.baikalelectronics.ru Git - kernel.git/commit
Input: atmel_mxt_ts - use snprintf for sysfs attribute show method
authorDaniel Kurtz <djkurtz@chromium.org>
Thu, 6 Oct 2011 22:43:20 +0000 (15:43 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 7 Oct 2011 02:41:52 +0000 (19:41 -0700)
commit1649637766149cdaa04540410cd6c57403014518
tree51e0230b67bd204f66288329c572a3fdd2b772bb
parentb3aa9941a07c515d6a232d83869c7ecb0ba81d74
Input: atmel_mxt_ts - use snprintf for sysfs attribute show method

Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE.  To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.

In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page.  Therefore, this patch also
trims some redundant framing text to leave more room for actual data.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/atmel_mxt_ts.c