mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-28 11:43:56 +00:00
dm: rb: only free rb_entry when we remove this entry from the rb tree
Only free rb_entry when we remove this entry from the rb tree, otherwise, a page fault would trigger when next rb itreation would access the freed rb_entry. Tracked-On: #6056 Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
parent
cf90f060c1
commit
805f103d1a
@ -248,13 +248,13 @@ unregister_mem_int(struct mmio_rb_tree *rbt, struct mem_range *memp)
|
||||
/* flush Per-VM cache */
|
||||
if (mmio_hint == entry)
|
||||
mmio_hint = NULL;
|
||||
|
||||
if (entry)
|
||||
free(entry);
|
||||
}
|
||||
}
|
||||
pthread_rwlock_unlock(&mmio_rwlock);
|
||||
|
||||
if (entry)
|
||||
free(entry);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user