From: Peter Hutterer Date: Wed, 12 Sep 2018 23:39:22 +0000 (+1000) Subject: test-xi2: add an extra NULL-check X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/5a8f3121c7f64dbb47fad99c027389e7d78453e4?ds=inline;hp=3ea8f02027b18cf06774c8f26a719e321e9a78f2 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 --- 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; }