xserver: Branch 'server-1.10-branch' - 6 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sun Mar 27 22:31:30 PDT 2011


 config/hal.c                   |    6 +++---
 config/udev.c                  |    6 +++---
 dix/devices.c                  |    2 ++
 hw/xfree86/common/xf86Config.c |   10 +++++++---
 hw/xfree86/common/xf86Xinput.c |    3 +++
 xkb/xkbActions.c               |   11 ++---------
 6 files changed, 20 insertions(+), 18 deletions(-)

New commits:
commit d1caa195abc648560f81356c40f08e7630544db9
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:33 2011 +0200

    config: Ensure that stolen option list elements are released.
    
    NewInputDeviceRequest steals the contents of option list elements but
    doesn't use the elements themselves for anything. Therefore the list
    elements need to be released always.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 4114533db6704324fc26f28a444415e325ace8e0)

diff --git a/config/hal.c b/config/hal.c
index 0b848a0..297520a 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -392,10 +392,10 @@ unwind:
     free(driver);
     free(name);
     free(config_info);
-    while (!dev && (tmpo = options)) {
+    while ((tmpo = options)) {
         options = tmpo->next;
-        free(tmpo->key);
-        free(tmpo->value);
+        free(tmpo->key);        /* NULL if dev != NULL */
+        free(tmpo->value);      /* NULL if dev != NULL */
         free(tmpo);
     }
 
diff --git a/config/udev.c b/config/udev.c
index ab27c98..678e47a 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -197,10 +197,10 @@ device_added(struct udev_device *udev_device)
 
  unwind:
     free(config_info);
-    while (!dev && (tmpo = options)) {
+    while ((tmpo = options)) {
         options = tmpo->next;
-        free(tmpo->key);
-        free(tmpo->value);
+        free(tmpo->key);        /* NULL if dev != NULL */
+        free(tmpo->value);      /* NULL if dev != NULL */
         free(tmpo);
     }
 
commit 241de6d72bdda9c925e22538aba4f91643ae0897
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:32 2011 +0200

    dix: Release input device config info when the device disconnects.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 8d30aff4aa708b9b885d492602ced7493a96a4df)

diff --git a/dix/devices.c b/dix/devices.c
index 89294aa..55f22cb 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -938,6 +938,8 @@ CloseDevice(DeviceIntPtr dev)
     }
 
     free(dev->deviceGrab.sync.event);
+    free(dev->config_info);     /* Allocated in xf86ActivateDevice. */
+    dev->config_info = NULL;
     dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
 }
 
commit 6a8313aee3ef06d92d8eba9ed77a963b5c5a9e7a
Author: Rami Ylimäki <rami.ylimaki at vincit.fi>
Date:   Fri Mar 4 17:55:31 2011 +0200

    xkb: Ensure that XKB device private won't leak on device disconnect.
    
    Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 40e56d34538f4663426db50893c231a2b5d760dc)

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 8d7c124..8c0c269 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -68,20 +68,13 @@ xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
 Bool
 XkbInitPrivates(void)
 {
-    return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, 0);
+    return dixRegisterPrivateKey(&xkbDevicePrivateKeyRec, PRIVATE_DEVICE, sizeof(xkbDeviceInfoRec));
 }
 
 void
 XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
 {
-    xkbDeviceInfoPtr xkbPrivPtr;
-
-    xkbPrivPtr = (xkbDeviceInfoPtr) calloc(1, sizeof(xkbDeviceInfoRec));
-    if (!xkbPrivPtr)
-	return;
-    xkbPrivPtr->unwrapProc = NULL;
-
-    dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr);
+    xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
     WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc);
 }
 
commit ee23ecc22ecac744ae2933f417f8a10dec938c94
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Mar 3 14:15:55 2011 +1000

    xfree86: block signals between EnableDevice and first CheckMotion()
    
    Devices usually enable SIGIO processing in EnableDevice. CheckMotion
    initialises the pointer sprite, sends Enter/Leave events, etc. This leaves
    us with a small window where events may be processed without the sprite or
    pointer position (as seen from the protocol) is valid.
    Block signals during this window.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit 18413f55089623123537c1499b02aa95ca2014d2)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 74365e1..e3264e6 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -817,15 +817,18 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
     /* Enable it if it's properly initialised and we're currently in the VT */
     if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
     {
+        OsBlockSignals();
         EnableDevice(dev, TRUE);
         if (!dev->enabled)
         {
+            OsReleaseSignals();
             xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
             rval = BadMatch;
             goto unwind;
         }
         /* send enter/leave event, update sprite window */
         CheckMotion(NULL, dev);
+        OsReleaseSignals();
     }
 
     *pdev = dev;
commit aef58ce5ba2d4a9140bb4d2860304ae64aa713da
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Tue Mar 8 13:29:41 2011 -0500

    xfree86/common: Remove a configScreen leak when conf_screen is NULL
    
    configScreen used a dynamically allocated buffer for XF86ConfScreenRec
    when conf_screen argument was NULL. This pointer was never stored
    anywhere, nor was it released, so this patch makes the function use
    automatically allocated storage in that situation.
    
    [ajax: minor grammar fix]
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    (cherry picked from commit a19771e4337d1c4600550314bbc42a1495a023ff)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 9602e89..5312ca6 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1787,9 +1787,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
     XF86ConfDisplayPtr dispptr;
     XF86ConfAdaptorLinkPtr conf_adaptor;
     Bool defaultMonitor = FALSE;
+    XF86ConfScreenRec local_conf_screen;
 
     if (!conf_screen) {
-        conf_screen = xnfcalloc(1, sizeof(XF86ConfScreenRec));
+        memset(&local_conf_screen, 0, sizeof(local_conf_screen));
+        conf_screen = &local_conf_screen;
         conf_screen->scrn_identifier = "Default Screen Section";
         xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
     }
commit efe69b45557368191fbb38555acb06736b09b6cb
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Sun Feb 27 20:16:03 2011 +0100

    Don't clobber input device options from xorg.conf
    
    Since commit b8d9c5ff removed commonOptions, we now
    need to append the "Core{Keyboard,Pointer}" options to
    the existing list.
    
    Fixes passing options to devices confirured in xorg.conf
    on systems where autoaddevices is false.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 00779932de861bf7ac8c625802f1afed75d01b6f)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 49d8fa8..9602e89 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1224,7 +1224,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
 	    *devs[count - 1] = Pointer;
 	    devs[count - 1]->options =
-				xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
+				xf86addNewOption(devs[count -1]->options,
+				    xnfstrdup("CorePointer"), NULL);
 	    devs[count] = NULL;
 	    servlayoutp->inputs = devs;
 	}
@@ -1364,7 +1365,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
 	    *devs[count - 1] = Keyboard;
 	    devs[count - 1]->options =
-				xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
+				xf86addNewOption(devs[count - 1]->options,
+				    xnfstrdup("CoreKeyboard"), NULL);
 	    devs[count] = NULL;
 	    servlayoutp->inputs = devs;
 	}


More information about the xorg-commit mailing list