Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 425f1cc2 authored by Hillf Danton's avatar Hillf Danton Committed by Stefano Stabellini
Browse files

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: default avatarHillf Danton <hdanton@sina.com>
Signed-off-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
parent 72813bfb
No related merge requests found
...@@ -156,6 +156,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn, ...@@ -156,6 +156,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn,
rc = xen_add_phys_to_mach_entry(p2m_entry); rc = xen_add_phys_to_mach_entry(p2m_entry);
if (rc < 0) { if (rc < 0) {
write_unlock_irqrestore(&p2m_lock, irqflags); write_unlock_irqrestore(&p2m_lock, irqflags);
kfree(p2m_entry);
return false; return false;
} }
write_unlock_irqrestore(&p2m_lock, irqflags); write_unlock_irqrestore(&p2m_lock, irqflags);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment