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>
This commit is contained in:
parent
6cea28fe4b
commit
8ffddbcf72
|
@ -844,6 +844,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
|
||||||
{
|
{
|
||||||
OsReleaseSignals();
|
OsReleaseSignals();
|
||||||
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
|
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
|
||||||
|
RemoveDevice(dev, TRUE);
|
||||||
rval = BadMatch;
|
rval = BadMatch;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user