Skip to content

Commit

Permalink
iommu/amd: Fix possible use after free in get_irq_table()
Browse files Browse the repository at this point in the history
We should return NULL on error instead of the freed pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Dan Carpenter authored and Joerg Roedel committed Oct 2, 2012
1 parent bdddadc commit 821f0f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3865,6 +3865,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic)
table->table = kmem_cache_alloc(amd_iommu_irq_cache, GFP_ATOMIC);
if (!table->table) {
kfree(table);
table = NULL;
goto out;
}

Expand Down

0 comments on commit 821f0f6

Please sign in to comment.