summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-05-09 14:30:49 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-06-06 08:58:27 +1000
commit8cc686735296f1ff32089e64f78dfee46b8e7149 (patch)
tree0c6ecdecea5312b74399109d285edbf6358edbb3 /dix
parentbf115aa906795df872104083c1187c126c3b1d76 (diff)
dix: don't overwrite proximity/focus classes
InitPointerClassDeviceStruct/InitKeyboardDeviceStruct allocate a proximity/focus class, respectively. If a driver calls InitFocusClassDeviceStruct or InitProximityClassDeviceStruct beforehand, the previously allocated class is overwritten, leaking the memory. Neither takes a parameter other than the device, so we can simply skip initialising it if we already have one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 8a88b0ab52ba375ae84463a90503db88af10e368)
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 85961a02a..b2db4aaf6 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1366,7 +1366,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
- if (mode & OutOfProximity)
+ if ((mode & OutOfProximity) && !dev->proximity)
InitProximityClassDeviceStruct(dev);
dev->valuator = valc;