Changing the initted address of a variable in the middle of a function running
is very dangerous. If it happens suddenly, it could make unexpected result and
must be hard to debug.
Change-Id: I55a489d490876ec2992b7949da8e2596f91644b6
static void
tbm_vc4_bo_free(tbm_bo bo)
{
- tbm_bo_vc4 bo_vc4;
+ tbm_bo_vc4 bo_vc4, temp;
tbm_bufmgr_vc4 bufmgr_vc4;
if (!bo)
int ret;
ret = drmHashLookup(bufmgr_vc4->hashBos, bo_vc4->name,
- (void **)&bo_vc4);
+ (void **)&temp);
if (ret == 0) {
drmHashDelete(bufmgr_vc4->hashBos, bo_vc4->name);
} else {
bo_vc4->name, ret);
}
+ if (temp != bo_vc4)
+ TBM_VC4_ERROR("hashBos probably has several BOs with same name!!!\n");
+
_bo_destroy_cache_state(bufmgr_vc4, bo_vc4);
/* Free gem handle */