[PATCH xts] XI/ChangePointerDevice: Check for XOpenDevice failures

Peter Harris pharris at opentext.com
Tue Jun 11 10:43:08 PDT 2013


Signed-off-by: Peter Harris <pharris at opentext.com>
---
 xts5/XI/ChangePointerDevice.m |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xts5/XI/ChangePointerDevice.m b/xts5/XI/ChangePointerDevice.m
index c7cb55f..dfd827a 100644
--- a/xts5/XI/ChangePointerDevice.m
+++ b/xts5/XI/ChangePointerDevice.m
@@ -160,6 +160,11 @@ int i, ndevices, savid;
 	    FAIL;
 	    }
 	device = XOpenDevice(display, savid);
+	if (!device) {
+		tet_infoline("ERROR: XOpenDevice failed");
+		tet_result(TET_UNRESOLVED);
+		return;
+	}
 	XCALL;
 	if (verify_ptr(display, savid))
 	    CHECK;
@@ -210,6 +215,11 @@ char *buttons;
 	XCALL;
 	XSync(display, 0);
 	dev = XOpenDevice (display, savid);
+	if (!dev) {
+		tet_infoline("ERROR: XOpenDevice failed");
+		tet_result(TET_UNRESOLVED);
+		return;
+	}
 	DeviceMotionNotify(dev, dmn, dmnc);
 	XSelectExtensionEvent (display, DRW(display), &dmnc, 1);
 	XSync(display, 0);
@@ -314,6 +324,11 @@ int i, ndevices, savid;
 	    FAIL;
 	    }
 	device = XOpenDevice(display, savid);
+	if (!device) {
+		tet_infoline("ERROR: XOpenDevice failed");
+		tet_result(TET_UNRESOLVED);
+		return;
+	}
 	XCALL;
 	if (verify_ptr(display, savid))
 	    CHECK;
@@ -700,6 +715,11 @@ XDevice bogus;
 		FAIL;
 
 	device = XOpenDevice(display, savid);
+	if (!device) {
+		tet_infoline("ERROR: XOpenDevice failed");
+		tet_result(TET_UNRESOLVED);
+		return;
+	}
 	XCALL;
 	XSync(display,0);
 	if (verify_ptr(display, savid))
-- 
1.7.10.4



More information about the xorg-devel mailing list