mirror of https://gitee.com/openkylin/linux.git
xen/arm: Free p2m entry if fail to add it to RB tree
Release the newly allocated p2m entry if we detect a duplicate in the RB tree. Signed-off-by: Hillf Danton <hdanton@sina.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
parent
72813bfbf0
commit
425f1cc221
|
@ -156,6 +156,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn,
|
|||
rc = xen_add_phys_to_mach_entry(p2m_entry);
|
||||
if (rc < 0) {
|
||||
write_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
kfree(p2m_entry);
|
||||
return false;
|
||||
}
|
||||
write_unlock_irqrestore(&p2m_lock, irqflags);
|
||||
|
|
Loading…
Reference in New Issue