xserver-multidpi/hw/xfree86/ramdac
Alex Goins 68d95e759f 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: Alex Goins <agoins@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-10-25 09:52:44 -04:00
..
BT.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
BT.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
BTPriv.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
CURSOR.NOTES Merging XORG-CURRENT into trunk 2004-04-23 19:54:30 +00:00
IBM.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
IBM.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
IBMPriv.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
Makefile.am tests: Avoid libtool message 2017-01-12 13:25:52 -05:00
meson.build Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
TI.c debug output format fix in TI.c 2015-08-28 12:06:39 +01:00
TI.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
TIPriv.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xf86Cursor.h xfree86: Immediately handle failure to set HW cursor, v5 2017-02-08 12:04:42 -05:00
xf86CursorPriv.h xf86Cursor: Add xf86CheckHWCursor() helper function 2016-09-13 10:26:58 +02:00
xf86CursorRD.c tests: Avoid libtool message 2017-01-12 13:25:52 -05:00
xf86HWCurs.c ramdac: Check ScreenPriv != NULL in xf86ScreenSetCursor() 2017-10-25 09:52:44 -04:00
xf86RamDac.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xf86RamDac.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xf86RamDacCmap.c xfree86: Remove #include "compiler.h" from places that don't need it 2014-07-28 12:18:03 -07:00
xf86RamDacPriv.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00