iommu/amd: Fix error code path in early_amd_iommu_init()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Jan 2017 13:57:28 +0000 (14:57 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 10 Jan 2017 13:57:34 +0000 (14:57 +0100)
Prevent early_amd_iommu_init() from leaking memory mapped via
acpi_get_table() if check_ivrs_checksum() returns an error.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu_init.c

index 6799cf9713f77f460f990e6bc0f38b31422c0745..3d3eb154c2ecc93c3fbfe9f4b7b352b3a742f824 100644 (file)
@@ -2230,7 +2230,7 @@ static int __init early_amd_iommu_init(void)
         */
        ret = check_ivrs_checksum(ivrs_base);
        if (ret)
-               return ret;
+               goto out;
 
        amd_iommu_target_ivhd_type = get_highest_supported_ivhd_type(ivrs_base);
        DUMP_printk("Using IVHD type %#x\n", amd_iommu_target_ivhd_type);