Skip to content
Commit 4ef1aef0 authored by Alex Goins's avatar Alex Goins Committed by Adam Jackson
Browse files

ramdac: Check ScreenPriv != NULL in xf86ScreenSetCursor()



Similar to change cba5a10f, xf86ScreenSetCursor() would dereference ScreenPriv
without NULL checking it. If Option "SWCursor" is specified, ScreenPriv == NULL.

Without this fix, it is observed that setting Option "SWCursor" "on" on the
modesetting driver in a PRIME configuration will segfault the server.

It is important to return success rather than failure in the instance that
ScreenPriv == NULL and pCurs == NullCursor, because otherwise xf86SetCursor()
can fall into infinite recursion: xf86SetCursor(pCurs) calls
xf86ScreenSetCursor(pCurs), and if FALSE, calls xf86SetCursor(NullCursor). If
xf86ScreenSetCursor(NullCursor) returns FALSE, it calls
xf86SetCursor(NullCursor) again and this repeats forever.

Signed-off-by: default avatarAlex Goins <agoins@nvidia.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
(cherry picked from commit 68d95e75)
parent cd5076a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment