diff options
author | Hillf Danton <hdanton@sina.com> | 2019-04-30 11:25:00 -0700 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2019-04-30 11:25:00 -0700 |
commit | 425f1cc2218af96d81dbec092155d436d6037d2c (patch) | |
tree | 339ae30f6d2eb6ed60437031e7f791050ab2e32f /arch/arm/xen | |
parent | 72813bfbf0276a97c82af038efb5f02dcdd9e310 (diff) |
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>
Diffstat (limited to 'arch/arm/xen')
-rw-r--r-- | arch/arm/xen/p2m.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c index e70a49fc8dcd..d3f632c88890 100644 --- a/arch/arm/xen/p2m.c +++ b/arch/arm/xen/p2m.c @@ -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); |