> Subject: [PATCH] xfree86: don't access the old input handler after freeing it
> 
> Introduced in 323869f3298cbbfe864af9404a8aed1bf7995d79
> 
> Signed-off-by: Peter Hutterer <[email protected]>

Reviewed-by: Dave Airlie <[email protected]>
> ---
>  hw/xfree86/common/xf86Events.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Events.c
> b/hw/xfree86/common/xf86Events.c
> index d8d4fad..377e936 100644
> --- a/hw/xfree86/common/xf86Events.c
> +++ b/hw/xfree86/common/xf86Events.c
> @@ -619,14 +619,16 @@ InputHandlerProc
>  xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
>  {
>      static IHPtr handler = NULL;
> -    IHPtr old_handler = handler;
> +    InputHandlerProc old_proc = NULL;
>  
> -    if (old_handler)
> -        xf86RemoveGeneralHandler(old_handler);
> +    if (handler) {
> +        old_proc = handler->ihproc;
> +        xf86RemoveGeneralHandler(handler);
> +    }
>  
>      handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
>  
> -    return (old_handler) ? old_handler->ihproc : NULL;
> +    return old_proc;
>  }
>  
>  static void
> --
> 1.8.1
> 
> 
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to