If a device being used is disconnected, it may be possible to find
yourself in a situation where a second device performs an "active"
check and dereferences a null (freed in 'wcmFree') 'priv' pointer.
To prevent this from occuring, always check if the device being
uninitialized is considered 'active' and unset it if so.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmConfig.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 138a769..5551087 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -236,6 +236,9 @@ static void wcmUninit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
 
        DBG(1, priv, "\n");
 
+       if (WACOM_DRIVER.active == priv)
+               WACOM_DRIVER.active = NULL;
+
        /* Server 1.10 will UnInit all devices for us */
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
        if (priv->isParent)
-- 
2.1.0


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to