]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iommu/vt-d: Check return value of acpi_bus_get_device()
authorJoerg Roedel <jroedel@suse.de>
Thu, 21 Aug 2014 21:06:48 +0000 (23:06 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 26 Aug 2014 09:15:17 +0000 (11:15 +0200)
Checking adev == NULL is not sufficient as
acpi_bus_get_device() might not touch the value of this
parameter in an error case, so check the return value
directly.

Fixes: ed40356b5fcf1ce28e026ab39c5b2b6939068b50
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
drivers/iommu/dmar.c

index 60ab474bfff38e58ba1e246d7da6ca3a201677cb..06d268abe951bebd946deac82cf092f3f7a67ee3 100644 (file)
@@ -678,8 +678,7 @@ static int __init dmar_acpi_dev_scope_init(void)
                                       andd->device_name);
                                continue;
                        }
-                       acpi_bus_get_device(h, &adev);
-                       if (!adev) {
+                       if (acpi_bus_get_device(h, &adev)) {
                                pr_err("Failed to get device for ACPI object %s\n",
                                       andd->device_name);
                                continue;