summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-06-25 14:22:31 +1000
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-01 17:38:28 -0700
commitb0e3696e01ec69e17b74164f4b366baef316f86c (patch)
treebea2b0bbcd2f8f8373ce55d414b1514bd0a51119
parentb99a4ac32cc613337af79eb130247364f478dd21 (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> (cherry picked from commit 55ff20eb37f00a3ad07b5acff19d4497ab513a97)
-rw-r--r--dix/touch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dix/touch.c b/dix/touch.c
index 04733ab35..ad48d8a66 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))