aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/evdev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/evdev.c b/src/evdev.c
index a4512cb..8d97243 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2349,6 +2349,15 @@ EvdevOpenDevice(InputInfoPtr pInfo)
}
}
+ /* Check major/minor of device node to avoid adding duplicate devices. */
+ pEvdev->min_maj = EvdevGetMajorMinor(pInfo);
+ if (EvdevIsDuplicate(pInfo))
+ {
+ xf86IDrvMsg(pInfo, X_WARNING, "device file is duplicate. Ignoring.\n");
+ EvdevCloseDevice(pInfo);
+ return BadMatch;
+ }
+
#ifdef MULTITOUCH
pEvdev->mtdev = mtdev_new_open(pInfo->fd);
if (pEvdev->mtdev)
@@ -2360,15 +2369,6 @@ EvdevOpenDevice(InputInfoPtr pInfo)
}
#endif
- /* Check major/minor of device node to avoid adding duplicate devices. */
- pEvdev->min_maj = EvdevGetMajorMinor(pInfo);
- if (EvdevIsDuplicate(pInfo))
- {
- xf86IDrvMsg(pInfo, X_WARNING, "device file is duplicate. Ignoring.\n");
- EvdevCloseDevice(pInfo);
- return BadMatch;
- }
-
return Success;
}