xserver: Branch 'server-1.5-branch'

Adam Jackson ajax at kemper.freedesktop.org
Fri May 16 06:50:23 PDT 2008


 config/hal.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1bd229d4ac36eaebf921a9b3526acd947ca0bfaf
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon May 5 14:37:07 2008 -0400

    Fix hal shutdown crash.
    
    Removing the device invalidates its ->next pointer.  Copy it aside before
    destroying the device.
    (cherry picked from commit f52f6c5c7efc281f9ac204fbaa4f71383df7463d)

diff --git a/config/hal.c b/config/hal.c
index 1575422..6534408 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -63,7 +63,7 @@ remove_device(DeviceIntPtr dev)
 static void
 device_removed(LibHalContext *ctx, const char *udi)
 {
-    DeviceIntPtr dev;
+    DeviceIntPtr dev, next;
     char *value;
 
     value = xalloc(strlen(udi) + 5); /* "hal:" + NULL */
@@ -71,11 +71,13 @@ device_removed(LibHalContext *ctx, const char *udi)
         return;
     sprintf(value, "hal:%s", udi);
 
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
+    for (dev = inputInfo.devices; dev; dev = next) {
+	next = dev->next;
         if (dev->config_info && strcmp(dev->config_info, value) == 0)
             remove_device(dev);
     }
-    for (dev = inputInfo.off_devices; dev; dev = dev->next) {
+    for (dev = inputInfo.off_devices; dev; dev = next) {
+	next = dev->next;
         if (dev->config_info && strcmp(dev->config_info, value) == 0)
             remove_device(dev);
     }


More information about the xorg-commit mailing list