2008-11-18 13:58:47 +01:00
|
|
|
>From 829037395f8b93e69a30852a95e378f78c3ccd6b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Luc Verhaegen <libv@skynet.be>
|
|
|
|
Date: Wed, 12 Nov 2008 17:09:33 +0100
|
|
|
|
Subject: [PATCH] Xinput: Catch missing configlayout when deleting device.
|
|
|
|
|
|
|
|
In DeleteInputDeviceRequest (xf86Xinput.c), we access idev members
|
|
|
|
even if idev is null. This takes down the xserver hard in some cases
|
|
|
|
(kernel SIGABRT), and segfaults on other cases.
|
2010-03-20 03:42:15 +01:00
|
|
|
================================================================================
|
|
|
|
--- xorg-server-1.7.99/hw/xfree86/common/xf86Xinput.c
|
|
|
|
+++ xorg-server-1.7.99/hw/xfree86/common/xf86Xinput.c
|
|
|
|
@@ -870,17 +870,20 @@
|
2009-03-02 01:19:45 +01:00
|
|
|
else
|
|
|
|
xf86DeleteInput(pInfo, 0);
|
2008-11-18 13:58:47 +01:00
|
|
|
|
2009-03-02 01:19:45 +01:00
|
|
|
- /* devices added through HAL aren't in the config layout */
|
|
|
|
- it = xf86ConfigLayout.inputs;
|
|
|
|
- while(*it && *it != idev)
|
|
|
|
- it++;
|
2008-11-18 13:58:47 +01:00
|
|
|
-
|
2009-03-02 01:19:45 +01:00
|
|
|
- if (!(*it)) /* end of list, not in the layout */
|
|
|
|
+ if (idev)
|
|
|
|
{
|
|
|
|
- xfree(idev->driver);
|
|
|
|
- xfree(idev->identifier);
|
|
|
|
- xf86optionListFree(idev->commonOptions);
|
|
|
|
- xfree(idev);
|
|
|
|
+ /* devices added through HAL aren't in the config layout */
|
|
|
|
+ it = xf86ConfigLayout.inputs;
|
|
|
|
+ while(*it && *it != idev)
|
|
|
|
+ it++;
|
2008-11-18 13:58:47 +01:00
|
|
|
+
|
2009-03-02 01:19:45 +01:00
|
|
|
+ if (!(*it)) /* end of list, not in the layout */
|
|
|
|
+ {
|
|
|
|
+ xfree(idev->driver);
|
|
|
|
+ xfree(idev->identifier);
|
|
|
|
+ xf86optionListFree(idev->commonOptions);
|
|
|
|
+ xfree(idev);
|
|
|
|
+ }
|
|
|
|
}
|
2008-11-18 13:58:47 +01:00
|
|
|
}
|
2009-03-02 01:19:45 +01:00
|
|
|
OsReleaseSignals();
|