Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 821f0f68 authored by Dan Carpenter's avatar Dan Carpenter Committed by Joerg Roedel
Browse files

iommu/amd: Fix possible use after free in get_irq_table()



We should return NULL on error instead of the freed pointer.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent bdddadcb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}