xserver: Branch 'master' - 2 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon Jul 21 23:25:20 PDT 2008


 dix/devices.c                  |    8 ++++++++
 hw/xfree86/common/xf86Helper.c |    6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 880625eef5d8b168df3e42836fa1b763c51a91b5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 22 14:34:28 2008 +0930

    xfree86: plug memory leak, free driver's private data when deleting the device.

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 41181b0..fedd7a3 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -357,11 +357,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
     if (pInp->drv)
 	pInp->drv->refCount--;
 
-    /* This should *really* be handled in drv->UnInit(dev) call instead */
-#if 0
+    /* This should *really* be handled in drv->UnInit(dev) call instead, but
+     * if the driver forgets about it make sure we free it or at least crash
+     * with flying colors */
     if (pInp->private)
 	xfree(pInp->private);
-#endif
 
     /* Remove the entry from the list. */
     if (pInp == xf86InputDevs)
commit 67d7821ae783d3f123b6ba7203abf847374a1e36
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Jul 21 11:48:24 2008 -0700

    dix: reset potential lastSlaves when disabling an SD
    
    Unplug a mouse, then warp the pointer and the warp pointer code will try
    to update the position of the last slave device associated with the
    master. That pointer will be stale and the X server will crash.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index 1cde5c0..383c1c7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -358,6 +358,14 @@ DisableDevice(DeviceIntPtr dev)
                 AttachDevice(NULL, other, NULL);
         }
     }
+    else
+    {
+        for (other = inputInfo.devices; other; other = other->next)
+        {
+	    if (other->isMaster && other->u.lastSlave == dev)
+		other->u.lastSlave = NULL;
+	}
+    }
 
     if (dev->isMaster && dev->spriteInfo->sprite)
     {


More information about the xorg-commit mailing list