[PATCH 1/7] xfree86/loader: Do not unload sibling modules.

Michal Suchanek hramrach at gmail.com
Mon Jul 23 08:14:31 PDT 2012


Ordering of sibling modules is internal to the loader implementation.

Unloading siblings following the requested module in the sibling list
leads to unexpected unloading of seemingly random modules.

Signed-off-by: Michal Suchanek <hramrach at gmail.com>
---
 hw/xfree86/loader/loadmod.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 2347b8e..65bf055 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1099,16 +1099,16 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
     else
         LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
 
+    RemoveChild(mod);
     if (mod->TearDownData != ModuleDuplicated) {
         if ((mod->TearDownProc) && (mod->TearDownData))
             mod->TearDownProc(mod->TearDownData);
         LoaderUnload(mod->name, mod->handle);
     }
 
-    if (mod->child)
+    while (mod->child)
         UnloadModuleOrDriver(mod->child);
-    if (mod->sib)
-        UnloadModuleOrDriver(mod->sib);
+
     free(mod->path);
     free(mod->name);
     free(mod);
-- 
1.7.10.4



More information about the xorg-devel mailing list