From: Ian Campbell Date: Wed, 1 Jun 2005 07:39:25 +0000 (-0500) Subject: Input: return correct value when setting up absolute device via uinipt. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6cbf3ef4f270c0dfe84b26649e4fc0c25bb0844;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Input: return correct value when setting up absolute device via uinipt. uinput_alloc_device() is supposed to return the number of bytes read, the value is returned to uinput_write() and from there to userspace. If EV_ABS is set then it returns the value from uinput_validate_absbits() instead, which is zero when everything is ok instead of the count. Signed-off-by: Ian Campbell Acked-by: Aristeu Rozanski Signed-off-by: Vojtech Pavlik Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 158c8e845ff9..98710997aaaa 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -298,9 +298,11 @@ static int uinput_alloc_device(struct file *file, const char __user *buffer, siz /* check if absmin/absmax/absfuzz/absflat are filled as * told in Documentation/input/input-programming.txt */ if (test_bit(EV_ABS, dev->evbit)) { - retval = uinput_validate_absbits(dev); - if (retval < 0) + int err = uinput_validate_absbits(dev); + if (err < 0) { + retval = err; kfree(dev->name); + } } exit: