zink: do not dereference NULL pointer
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 14 Apr 2021 13:44:16 +0000 (15:44 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Apr 2021 15:04:35 +0000 (15:04 +0000)
commit9de05fd36bc7efcda35f6fc107a58b837bc0403b
treea0717f82acb74d6dd044a5a359e7a103dba98443
parentf3e004cb56af3c770e1ad1ee00a39f958314560f
zink: do not dereference NULL pointer

If first_frame_done isn't set, but fence is NULL, we end up dereferncing
that NULL-pointer.

This can happen in the case where the first submitted batch has no work,
and pfence was passed as a NULL-pointer.

While we're at it, simplify the check with the surrounding code, which
also checks for a NULL-pointer here.

Fixes: e93ca92d4ae ("zink: force explicit fence only on first frame flush")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10235>
src/gallium/drivers/zink/zink_context.c