From: Peter Korsgaard Date: Fri, 25 Feb 2011 17:30:46 +0000 (-0800) Subject: Input: evdev - fix evdev_write return value on partial writes X-Git-Tag: v2.6.39-rc1~410^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=439581ec07fa9cf3f519dd461a2cf41cfd3adcb4;p=pandora-kernel.git Input: evdev - fix evdev_write return value on partial writes As was recently brought up on the busybox list (http://lists.busybox.net/pipermail/busybox/2011-January/074565.html), evdev_write doesn't properly check the count argument, which will lead to a return value > count on partial writes if the remaining bytes are accessible - causing userspace confusion. Fix it by only handling each full input_event structure and return -EINVAL if less than 1 struct was written, similar to how it is done in evdev_read. Reported-by: Baruch Siach Signed-off-by: Peter Korsgaard Acked-by: Henrik Rydberg Signed-off-by: Dmitry Torokhov --- Reading git-diff-tree failed