summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-08-12 12:06:18 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-12 14:41:19 +1000
commitdd4e21cb3a6e692e834ec34bec42944202b3e085 (patch)
treeeaf57f5017f8aaab4f2a36d46f578eb956398833 /hw/xfree86/common
parentbf31d6f43e5ce04891a96b226a975379e2e2ba71 (diff)
xfree86: fix unbalanced input_lock/unlock in xf86NewInputDevice()
If a device couldn't be enabled we left the lock hanging. This patch also removes the leftover OsReleaseSignals() call, now unnecessary. Note that input_unlock() is later than previously OsReleaseSignals(). RemoveDevice() manipulates the input device and its file descriptors, it's safer to put the input_unlock() call after RemoveDevice() to avoid events coming in while the device is being removed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86Xinput.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 42d0f32f3..3e6a264d0 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -957,10 +957,10 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
input_lock();
EnableDevice(dev, TRUE);
if (!dev->enabled) {
- OsReleaseSignals();
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
rval = BadMatch;
+ input_unlock();
goto unwind;
}
/* send enter/leave event, update sprite window */