summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-09-13 09:39:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-09-13 09:39:22 +1000
commit5a8f3121c7f64dbb47fad99c027389e7d78453e4 (patch)
treed69c9b827c5d922e5a40d286c5eb2bede18d58d8
parent3ea8f02027b18cf06774c8f26a719e321e9a78f2 (diff)
test-xi2: add an extra NULL-check
Shuts up coverity because it doesn't know that by the time we get here, we're guaranteed that the device exists. Otherwise the list() call a few lines above would've failed and we wouldn't get here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/test_xi2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test_xi2.c b/src/test_xi2.c
index 402acac..10a46c3 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -358,6 +358,10 @@ test_xi2(Display *display,
if (argc >= 1) {
XIDeviceInfo *info;
info = xi2_find_device_info(display, argv[0]);
+ /* info is alway valid, the list() call exits if the device
+ cannot be found, but let's shut up coverity */
+ if (!info)
+ return EXIT_FAILURE;
deviceid = info->deviceid;
}