Input: set EV_ABS in dev->evbit even if input_alloc_absinfo() fails
authorHans de Goede <hdegoede@redhat.com>
Tue, 1 Mar 2022 06:57:26 +0000 (22:57 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 1 Mar 2022 07:26:25 +0000 (23:26 -0800)
commit3f9ed5c2fe36794c1b11697bbbc6c8ec82a7d3dc
tree9d6c6d9bcb6833b1a948766695d55f5e76a1f713
parent986c6f7c3fc855032f3457a5a1b7fbcc09c375bb
Input: set EV_ABS in dev->evbit even if input_alloc_absinfo() fails

The input core's error handling for input_alloc_absinfo() failures
is based on ignoring the error until input_register_device() runs
and then checks for the failure like this:

        if (test_bit(EV_ABS, dev->evbit) && !dev->absinfo) {
                dev_err(&dev->dev, ...);
                return -EINVAL;
        }

This relies on EV_ABS actually getting set in dev->evbit even
if input_alloc_absinfo() fails, change input_set_abs_params() and
input_set_capability() to actually adhere to this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220131143539.109142-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c