[PATCH] dix: Don't let a driver without a ProximityClassRec post events

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 2 17:37:24 PDT 2011


We dereference dev->proximity for proximity events in UpdateDeviceState().
Unconditionally, on the premise that a device that sends proximity events
has a ProximityClassRec. Let that premise be true.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index b1f0d86..7679417 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1513,7 +1513,7 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const Val
     /* Sanity checks. */
     if ((type != ProximityIn && type != ProximityOut) || !mask_in)
         return 0;
-    if (!pDev->valuator)
+    if (!pDev->valuator || !pDev->proximity)
         return 0;
 
     valuator_mask_copy(&mask, mask_in);
-- 
1.7.7



More information about the xorg-devel mailing list