xserver: Branch 'master' - 5 commits

Daniel Stone daniels at kemper.freedesktop.org
Fri Dec 28 05:51:30 PST 2007


 config/dbus-core.c      |    5 ++++-
 config/hal.c            |   11 ++++++++++-
 dix/devices.c           |    3 ++-
 hw/kdrive/ephyr/ephyr.c |    1 +
 os/connection.c         |    3 ++-
 5 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 24105cf6582201a94bc39aeac5a795297018aeb5
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Dec 28 15:49:50 2007 +0200

    Input: Don't reinit devices
    
    If a device is already initialised (i.e. the virtual core devices) during
    IASD, don't init them again.  This fixes a leak.

diff --git a/dix/devices.c b/dix/devices.c
index adf2fba..534a0b9 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -469,7 +469,8 @@ InitAndStartDevices(void)
 
     for (dev = inputInfo.off_devices; dev; dev = dev->next) {
         DebugF("(dix) initialising device %d\n", dev->id);
-	ActivateDevice(dev);
+        if (!dev->inited)
+            ActivateDevice(dev);
     }
     for (dev = inputInfo.off_devices; dev; dev = next)
     {
commit 941058f8da0d725f909dc97f68c32ce244a9dc0a
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Dec 28 15:48:57 2007 +0200

    KDrive: Xephyr: Don't leak screen damage structure

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index a4d995c..2a762a2 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -402,6 +402,7 @@ ephyrUnsetInternalDamage (ScreenPtr pScreen)
   
   pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
   DamageUnregister (&pPixmap->drawable, scrpriv->pDamage);
+  DamageDestroy (scrpriv->pDamage);
   
   RemoveBlockAndWakeupHandlers (ephyrInternalDamageBlockHandler,
 				ephyrInternalDamageWakeupHandler,
commit b2f6cd290c43b88f0d08fb29f8657618a067d2a0
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Dec 28 15:48:25 2007 +0200

    OS: Don't leak connection translation table on regeneration

diff --git a/os/connection.c b/os/connection.c
index 3b5742c..8b6541c 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -353,7 +353,8 @@ InitConnectionLimits(void)
 #endif
 
 #if !defined(WIN32)
-    ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1));
+    if (!ConnectionTranslation)
+        ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1));
 #else
     InitConnectionTranslation();
 #endif
commit 190a0506243b39cd8dfc0e12068e3a3f416330f1
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Dec 28 15:47:57 2007 +0200

    Config: HAL: Don't leak options on failure to add device
    
    This showed up in Xephyr in particular, which denies new device requests.

diff --git a/config/hal.c b/config/hal.c
index af96fc2..4ab2961 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -92,6 +92,8 @@ add_option(InputOption **options, const char *key, const char *value)
     for (; *options; options = &(*options)->next)
         ;
     *options = xcalloc(sizeof(**options), 1);
+    if (!*options) /* Yeesh. */
+        return;
     (*options)->key = xstrdup(key);
     (*options)->value = xstrdup(value);
     (*options)->next = NULL;
@@ -156,7 +158,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
     char *path = NULL, *driver = NULL, *name = NULL, *xkb_rules = NULL;
     char *xkb_model = NULL, *xkb_layout = NULL, *xkb_variant = NULL;
     char *xkb_options = NULL, *config_info = NULL;
-    InputOption *options = NULL;
+    InputOption *options = NULL, *tmpo = NULL;
     DeviceIntPtr dev;
     DBusError error;
     int type = TYPE_NONE;
@@ -234,6 +236,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
 
     if (NewInputDeviceRequest(options, &dev) != Success) {
         DebugF("[config/hal] NewInputDeviceRequest failed\n");
+        dev = NULL;
         goto unwind;
     }
 
@@ -259,6 +262,12 @@ unwind:
         xfree(xkb_options);
     if (config_info)
         xfree(config_info);
+    while (!dev && (tmpo = options)) {
+        options = tmpo->next;
+        xfree(tmpo->key);
+        xfree(tmpo->value);
+        xfree(tmpo);
+    }
 
 out_error:
     dbus_error_free(&error);
commit f44fd3f9e41bf467360ace93ef5b532d8f61fb2c
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Dec 28 15:47:21 2007 +0200

    Config: D-Bus: Don't leak timers
    
    TimerCancel doesn't free the timer: you need TimerFree for that.

diff --git a/config/dbus-core.c b/config/dbus-core.c
index eab72a5..9cf1530 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -76,7 +76,7 @@ teardown(void)
     struct config_dbus_core_hook *hook;
 
     if (bus_info.timer) {
-        TimerCancel(bus_info.timer);
+        TimerFree(bus_info.timer);
         bus_info.timer = NULL;
     }
 
@@ -116,6 +116,8 @@ message_filter(DBusConnection *connection, DBusMessage *message, void *data)
         bus_info.connection = NULL;
         teardown();
 
+        if (bus_info.timer)
+            TimerFree(bus_info.timer);
         bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
 
         return DBUS_HANDLER_RESULT_HANDLED;
@@ -186,6 +188,7 @@ static CARD32
 reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg)
 {
     if (connect_to_bus()) {
+        TimerFree(bus_info.timer);
         bus_info.timer = NULL;
         return 0;
     }


More information about the xorg-commit mailing list