summaryrefslogtreecommitdiff
blob: 57c7349da6a7b1ff6afc32224451e32a7c1a6840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff -u13 -r xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c xorg-server-1.12.3/hw/xfree86/loader/loadmod.c
--- xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c	2012-09-05 18:26:42.000000000 +0200
+++ xorg-server-1.12.3/hw/xfree86/loader/loadmod.c	2012-09-05 18:28:54.000000000 +0200
@@ -1109,39 +1109,38 @@
 static void
 RemoveChild(ModuleDescPtr child)
 {
     ModuleDescPtr mdp;
     ModuleDescPtr prevsib;
     ModuleDescPtr parent;
 
     if (!child->parent)
         return;
 
     parent = child->parent;
     if (parent->child == child) {
         parent->child = child->sib;
-        return;
-    }
-
-    prevsib = parent->child;
-    mdp = prevsib->sib;
-    while (mdp && mdp != child) {
-        prevsib = mdp;
-        mdp = mdp->sib;
+    }
+    else {
+        prevsib = parent->child;
+        mdp = prevsib->sib;
+        while (mdp && mdp != child) {
+            prevsib = mdp;
+            mdp = mdp->sib;
+        }
+        if (mdp == child)
+            prevsib->sib = child->sib;
     }
-    if (mdp == child)
-        prevsib->sib = child->sib;
     child->sib = NULL;
-    return;
 }
 
 void
 LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
 {
     const char *msg;
     MessageType type = X_ERROR;
 
     switch (errmaj) {
     case LDR_NOERROR:
         msg = "no error";
         break;
     case LDR_NOMEM: