From 55ff20eb37f00a3ad07b5acff19d4497ab513a97 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 25 Jun 2012 14:22:31 +1000 Subject: [PATCH] dix: fix dereference before null check Found by Coverity. Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie --- dix/touch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))