[PATCH 7/7] evdev: checked_return: EvdevProbe: Unchecked call

Oliver McFadden oliver.mcfadden at nokia.com
Mon Apr 19 21:11:22 PDT 2010


Called function "ioctl" whose return value should be checked (checked 10
out of 11 times)

Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
---
 src/evdev.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 6992c68..ccea90d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1782,8 +1782,9 @@ EvdevProbe(InputInfoPtr pInfo)
             xf86Msg(X_ERROR, "Grab failed. Device already configured?\n");
             return 1;
         }
-    } else if (pEvdev->grabDevice) {
-        ioctl(pInfo->fd, EVIOCGRAB, (void *)0);
+    } else if (pEvdev->grabDevice && ioctl(pInfo->fd, EVIOCGRAB, (void *)0)) {
+        xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name,
+               strerror(errno));
     }
 
     /* Trinary state for ignoring axes:
-- 
1.6.1



More information about the xorg-devel mailing list