diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-12-23 16:05:16 +1000 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2009-12-30 17:45:23 +0000 |
commit | b8b12e41c453c3bf94b11e7a18934d3b6e1869bf (patch) | |
tree | f730087030b05c7bef4c73d275a872628e0109f2 | |
parent | 9fad8f06fb89ac2ae05bea0fa24cab3df7677297 (diff) |
xfree86: move sanity checks below option and input classes merges.
While the identifier is likely set before the input classes are merged, the
driver may not be. Hence don't check for a driver before we've completed
configuration for this device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index e0c783089..87b5100fa 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -702,16 +702,6 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, } } } - if (!idev->driver || !idev->identifier) { - xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n"); - rval = BadRequest; - goto unwind; - } - - if (!idev->identifier) { - xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n"); - return BadMatch; - } for (option = options; option; option = option->next) { /* Steal option key/value strings from the provided list. @@ -729,6 +719,17 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, goto unwind; } + if (!idev->driver || !idev->identifier) { + xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n"); + rval = BadRequest; + goto unwind; + } + + if (!idev->identifier) { + xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n"); + return BadMatch; + } + rval = xf86NewInputDevice(idev, pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); if (rval == Success) |