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>
This commit is contained in:
parent
bf31d6f43e
commit
dd4e21cb3a
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue