• Aaron Plattner's avatar
    privates: Clear screen-specific keys during CloseScreen · 82eb490b
    Aaron Plattner authored
    The modesetting driver corrupts memory when used after a server regeneration
    because not enough memory is allocated for its pixmap privates.  This happens
    because its call to dixRegisterScreenSpecificPrivateKey() does nothing because
    key->initialized is still TRUE from the first server generation.  However, the
    key is not in the screen's linked list of screen-specific privates because
    that's freed and reallocated during the server generation loop in dix_main().
    
    Fix this by clearing key->initialized before CloseScreen and add a call to
    dixFreeScreenSpecificPrivates() for GPU screens.
    
    v2: Just set key->initialized to FALSE and move dixFreeScreenSpecificPrivates()
    calls to after CloseScreen.
    
    v3: Move dixFreeScreenSpecificPrivates() calls back to just before CloseScreen.
    Signed-off-by: default avatarAaron Plattner <aplattner@nvidia.com>
    Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
    82eb490b
privates.c 22.3 KB