summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-06-25 14:22:31 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-07-04 21:16:16 +1000
commit55ff20eb37f00a3ad07b5acff19d4497ab513a97 (patch)
treef9f4aa779b6dc80b0a3e68baafcc5734ad01d1d9
parente3f47be9fbc489e3eb5832445924810b2ff300f7 (diff)
dix: fix dereference before null check
Found by Coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--dix/touch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dix/touch.c b/dix/touch.c
index a01f152cd..06b15ef4b 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
int i;
TouchClassPtr t = dev->touch;
DDXTouchPointInfoPtr ti = NULL;
- Bool emulate_pointer = (t->mode == XIDirectTouch);
+ Bool emulate_pointer;
if (!t)
return NULL;
+ emulate_pointer = (t->mode == XIDirectTouch);
+
/* Look for another active touchpoint with the same DDX ID. DDX
* touchpoints must be unique. */
if (TouchFindByDDXID(dev, ddx_id, FALSE))