etnaviv: fix NULL pointer dereference in TS allocation
authorLucas Stach <l.stach@pengutronix.de>
Tue, 22 Nov 2022 09:21:43 +0000 (10:21 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Nov 2022 18:30:41 +0000 (18:30 +0000)
commit74ff3f70bb37fb3f33733af0d006ec3858a7b407
treea6464e7dbb636d7991438fd340bf7a256031d8b1
parent3aadbb9fdec0623337dced7e829cb11149647a16
etnaviv: fix NULL pointer dereference in TS allocation

Commit c2b06e1a3820 ("etnaviv: add support for sharing the TS buffer")
introduced a problem similar to the one fixed in 3b3cd5128672 ("etnaviv:
fix renderonly check in etna_resource_alloc") in a different code path.
This causes a NULL pointer dereference when the screen is instanciated
on the render node. Fix it in the same way by just checking for a valid
pointer.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19923>
src/gallium/drivers/etnaviv/etnaviv_resource.c