[PATCH evdev] Return BadValue if EvdevOpenMTDev fails

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 11 19:18:05 PST 2013


FALSE == Success, so if we fail during EvdevOpenMTDev, the caller thinks
that everything worked fine, proceeds to set up the fd, etc.

This may later cause a crash, when a device comes back later as different
device and posts axis events where we didn't configure axes in the first
place.

Note: Unclear why there was no udev event received for the device being
removed and coming back as different device though.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/evdev.c b/src/evdev.c
index 84afa01..7f145dd 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2511,7 +2511,7 @@ EvdevOpenDevice(InputInfoPtr pInfo)
     if (!EvdevOpenMTDev(pInfo)) {
         xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name);
         EvdevCloseDevice(pInfo);
-        return FALSE;
+        return BadValue;
     }
 #endif
 
-- 
1.8.1.2



More information about the xorg-devel mailing list