summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-08-22 01:06:48 +0400
committerJoerg Roedel <jroedel@suse.de>2014-08-26 13:15:17 +0400
commitc0df975f9045d6b2b13d88746e628ac308ff49ea (patch)
tree48058cedcc8de6cea39c21949daa60059087b3c0 /drivers/iommu
parentc4a783b89ee3fc1201510ecf204278da4ccb0993 (diff)
downloadlinux-c0df975f9045d6b2b13d88746e628ac308ff49ea.tar.xz
iommu/vt-d: Check return value of acpi_bus_get_device()
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/dmar.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 60ab474bfff3..06d268abe951 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -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;