eis: don't EINVAL if a coordinate is outside the region

From the documentation:
"The x/y coordinate must be within the device's regions or the event is
silently discarded."

libei discards it but if it somehow makes it through anyway, let's
discard it again.
This commit is contained in:
Peter Hutterer 2023-02-23 16:01:47 +10:00
parent e93ad6925c
commit 1748ddaf3d

View file

@ -740,10 +740,8 @@ eis_device_event_pointer_abs(struct eis_device *device,
if (device->state != EIS_DEVICE_STATE_EMULATING)
return -EINVAL;
if (!eis_device_in_region(device, x, y))
return -EINVAL;
eis_queue_pointer_abs_event(device, x, y);
if (eis_device_in_region(device, x, y))
eis_queue_pointer_abs_event(device, x, y);
return 0;
}