From: Joerg Roedel Date: Fri, 22 May 2009 10:48:05 +0000 (+0200) Subject: amd-iommu: make sure only ivmd entries are parsed X-Git-Tag: v2.6.31-rc1~408^2~12 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0bc252f430d6a3ac7836d40f00d0ae020593b11b;p=karo-tx-linux.git amd-iommu: make sure only ivmd entries are parsed 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 --- diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 53f93db54c4d..a3a2b98bb39e 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c @@ -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;