UnloadSubModule(): accept pointer value '1' and ignore it.

Some driver modules try to unload submodules that are now built-in.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Matthieu Herrb 2012-01-02 13:11:41 +00:00 committed by Keith Packard
parent 8db029064b
commit dafc327f3c

View File

@ -1090,6 +1090,9 @@ UnloadSubModule(pointer _mod)
{ {
ModuleDescPtr mod = (ModuleDescPtr)_mod; ModuleDescPtr mod = (ModuleDescPtr)_mod;
/* Some drivers are calling us on built-in submodules, ignore them */
if (mod == (ModuleDescPtr)1)
return;
RemoveChild(mod); RemoveChild(mod);
UnloadModuleOrDriver(mod); UnloadModuleOrDriver(mod);
} }