OSDN Git Service

freedreno: fix use-after-free with stateobj rb's
authorRob Clark <robclark@freedesktop.org>
Wed, 8 Aug 2018 14:39:52 +0000 (10:39 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 8 Aug 2018 18:31:17 +0000 (14:31 -0400)
commit879d7c0298d1d4bc52d71d599cc07cafb4645808
tree0c3a0a4621760f5d8b4f8caacabf9e0314b3b716
parenta43940eb91a88ace5519c353caaab0c85a8c0d51
freedreno: fix use-after-free with stateobj rb's

We could be dropping last reference in ->flush(), so clear the entry in
the parent rb's table to avoid deref'ing after free'd.

Also, ring_bo_del()'s use of ring_cache expects that it is dropping the
last reference.  So drop our ref to the stateobj's ring_bo first.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/msm/msm_ringbuffer.c