On 23 June 2017 at 01:29, Dave Airlie <airl...@gmail.com> wrote:
> From: Dave Airlie <airl...@redhat.com>
>
> We had a bug reported with a touchscreen where we could end up
> in here with a NULL cursor, so let's not crash the X server.

I'm able to reproduce the bug reliable and can confirm that this patch
fixes the issue.

Reviewed-and-Tested-by: Daniel Martin <consume.no...@gmail.com>

> Signed-off-by: Dave Airlie <airl...@redhat.com>
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index aa6baae..71a6923 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -759,6 +759,9 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
>      CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen);
>      int ret = -EINVAL;
>
> +    if (cursor == NullCursor)
> +           return TRUE;
> +
>      ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
>                              handle, ms->cursor_width, ms->cursor_height,
>                              cursor->bits->xhot, cursor->bits->yhot);
> --
> 2.9.4
>
> _______________________________________________
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to