mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 04:33:55 +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,12 +248,12 @@ unregister_mem_int(struct mmio_rb_tree *rbt, struct mem_range *memp)
|
|||||||
/* flush Per-VM cache */
|
/* flush Per-VM cache */
|
||||||
if (mmio_hint == entry)
|
if (mmio_hint == entry)
|
||||||
mmio_hint = NULL;
|
mmio_hint = NULL;
|
||||||
}
|
|
||||||
}
|
|
||||||
pthread_rwlock_unlock(&mmio_rwlock);
|
|
||||||
|
|
||||||
if (entry)
|
if (entry)
|
||||||
free(entry);
|
free(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pthread_rwlock_unlock(&mmio_rwlock);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user