summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2015-04-29 15:08:58 +1000
committerKeith Packard <keithp@keithp.com>2015-05-11 15:43:04 -0700
commit9ff89a2e469ab0ac5af57d0fc115127feb1c0d99 (patch)
tree8438c766bdef2404aa803ef9564475f5813a295f /dix
parentfa62ca68ef8be7f63cd0b899dfae3366ca9350cf (diff)
dix: Do not allow device transform to be set on valuatorless devices
If a device does not have any valuators, it makes no sense to set the device transformation. Return a BadMatch error to let the caller know that they're trying something stupid. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index b2de6f10b..1f8dabddd 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -177,6 +177,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
if (!isfinite(f[i]))
return BadValue;
+ if (!dev->valuator)
+ return BadMatch;
+
if (!checkonly)
DeviceSetTransform(dev, f);
}