mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-09 03:58:34 +00:00
dm: rb: only free rb_entry when we remove this entry from the
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> Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
2e08f32e7a
commit
65a957dff8
@ -346,12 +346,12 @@ unregister_mem(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