From 8ffddbcf72170e246826ee0f39f18989a29fa218 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Jun 2011 16:30:28 +1000 Subject: [PATCH] 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 Reviewed-by: Daniel Stone --- hw/xfree86/common/xf86Xinput.c | 1 + 1 file changed, 1 insertion(+) 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; }