提交 425f1cc2 编写于 作者: H Hillf Danton 提交者: Stefano Stabellini

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: NHillf Danton <hdanton@sina.com>
Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
上级 72813bfb
无相关合并请求
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部