Re: [PATCH v2 2/2] Input: uinput: return -EINVAL for out-of-range UI_ABS_SETUP axis code
From: Dmitry Torokhov
Date: Tue Oct 27 2026 - 14:41:06 EST
Hi Iván,
On Mon, Aug 31, 2026 at 04:27:52PM -0300, Iván Ezequiel Rodriguez wrote:
> uinput_abs_setup() rejects an axis code above ABS_MAX with -ERANGE, but
> the UI_ABS_SETUP documentation in include/uapi/linux/uinput.h states the
> ioctl may only fail with -EINVAL, -ENOMEM or -EFAULT. An out-of-range
> code is exactly the "incorrect values" case described there, and every
> other validation failure in this path already returns -EINVAL.
>
> Return -EINVAL so the code matches its documented uapi contract.
I wonder if it would not be better to update the documentation rather
than change user-visible behavior.
Thanks.
--
Dmitry