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

Julien Cristau jcristau at debian.org
Sun Jan 1 09:39:01 PST 2012


On Sun, Jan  1, 2012 at 18:26:11 +0100, Matthieu Herrb wrote:

> Some driver modules try to unload submodules that are now built-in.
> 
> Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
> ---
>  hw/xfree86/loader/loadmod.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
> index 5b9f8d1..c53dfc0 100644
> --- a/hw/xfree86/loader/loadmod.c
> +++ b/hw/xfree86/loader/loadmod.c
> @@ -1089,7 +1089,8 @@ void
>  UnloadSubModule(pointer _mod)
>  {
>      ModuleDescPtr mod = (ModuleDescPtr)_mod;
> -
> +    if (_mod == (pointer)1)
> +	return;

Maybe add a comment, and use if (mod == (ModuleDescPtr)1)?  Either way,
Reviewed-by: Julien Cristau <jcristau at debian.org>

>      RemoveChild(mod);
>      UnloadModuleOrDriver(mod);
>  }

Cheers,
Julien


More information about the xorg-devel mailing list