iris: Don't leak resources in iris_create_surface for incomplete FBOs
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 28 Jun 2019 00:16:20 +0000 (17:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 28 Jun 2019 08:13:11 +0000 (01:13 -0700)
commit847ef8ee4f0889be651f12ad5bbc7e43a177431a
tree059bbc9e2df461155eb876d383da205bd365c1ba
parentef1787dbc95e138b782fef1fcc93279ccf0e4910
iris: Don't leak resources in iris_create_surface for incomplete FBOs

We were failing to pipe_resource_unreference on the failure path due
to a non-renderable format.  Instead of fixing this, just move the
checks earlier, before we even bother with refcounting or calloc.
src/gallium/drivers/iris/iris_state.c