From dd4e21cb3a6e692e834ec34bec42944202b3e085 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 12 Aug 2016 12:06:18 +1000 Subject: [PATCH] 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 Reviewed-by: Keith Packard --- hw/xfree86/common/xf86Xinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */