[PATCH xserver] present: Be consistent in using window vs vblank->window in present_execute()

Michel Dänzer michel at daenzer.net
Wed Apr 20 03:56:13 UTC 2016


On 19.04.2016 17:21, Chris Wilson wrote:
> Upon entering the function, we copy frequently accessed members of the
> vblank structure to locals (such as the Window). However, we then
> fluctuate between using the local window and the vblank->window. Under
> certain situations, the present_flip callback into the driver may be
> completed instantaneously and so accessing the vblank structure after a
> successful call into the driver may cause a use-after-free. This is
> trivially avoided by using the locals we took earlier.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

The shortlog is a bit long and maybe shouldn't mention window
specifically, e.g. something like "present: Use more local variables
instead of struct members in present_execute". Either way,

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list