mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-20 14:16:02 +00:00
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: cc580e4126
("iommu/vt-d: Per PCI device pasid table interfaces")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
5daab58043
commit
dca4d60f5f
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue