amd-iommu: make sure only ivmd entries are parsed
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 22 May 2009 10:48:05 +0000 (12:48 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 28 May 2009 16:06:47 +0000 (18:06 +0200)
The bug never triggered. But it should be fixed to protect against
broken ACPI tables in the future.

[ Impact: protect against broken ivrs acpi table ]

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/kernel/amd_iommu_init.c

index 53f93db54c4da31694233d260baff3e5993e7ec7..a3a2b98bb39e440497f2a4485439b6a19a16a1de 100644 (file)
@@ -906,6 +906,8 @@ static int __init init_unity_map_range(struct ivmd_header *m)
 
        switch (m->type) {
        default:
+               kfree(e);
+               return 0;
        case ACPI_IVMD_TYPE:
                e->devid_start = e->devid_end = m->devid;
                break;