Commit dca4d60f authored by Eric Auger's avatar Eric Auger Committed by Joerg Roedel

iommu/vt-d: Fix leak in intel_pasid_alloc_table on error path

If alloc_pages_node() fails, pasid_table is leaked. Free it.

Fixes: cc580e41 ("iommu/vt-d: Per PCI device pasid table interfaces")
Signed-off-by: default avatarEric Auger <eric.auger@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 5daab580
......@@ -154,8 +154,10 @@ int intel_pasid_alloc_table(struct device *dev)
order = size ? get_order(size) : 0;
pages = alloc_pages_node(info->iommu->node,
GFP_KERNEL | __GFP_ZERO, order);
if (!pages)
if (!pages) {
kfree(pasid_table);
return -ENOMEM;
}
pasid_table->table = page_address(pages);
pasid_table->order = order;
......
Markdown is supported
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