summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-06-27 16:30:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-27 09:31:01 +1000
commit8ffddbcf72170e246826ee0f39f18989a29fa218 (patch)
treebf9bd801b64613e86ce308915cfb599ebfe53079
parent6cea28fe4b7a4a22ad270d8c71403db84a9bfb2c (diff)
xfree86: Remove devices that failed to enable on startup
Devices that succeeded during PreInit and DEVICE_INIT but failed in DEVICE_ON would be deleted through xf86DeleteInput but not removed from the list of input devices (and not turned off). The result was a double free on server shutdown. Fix this by calling RemoveDevice if EnableDevice fails. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--hw/xfree86/common/xf86Xinput.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 26051ad7f..d22fdc8b9 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -844,6 +844,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
{
OsReleaseSignals();
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
+ RemoveDevice(dev, TRUE);
rval = BadMatch;
goto unwind;
}