Skip to content

Commit

Permalink
xen/arm: Free p2m entry if fail to add it to RB tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hillf Danton authored and Stefano Stabellini committed Apr 30, 2019
1 parent 72813bf commit 425f1cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 425f1cc

Please sign in to comment.