summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-08-21 23:06:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 13:40:59 -0700
commit45b03a62e3d86c405b9dd21068fe77a9a144971f (patch)
tree9a4062b0fe113285ebd4535404ccb53b057120bc
parent7e6db41703b15e883cb4cd7eebfd5175e9adecc3 (diff)
iommu/vt-d: Check return value of acpi_bus_get_device()
commit c0df975f9045d6b2b13d88746e628ac308ff49ea upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 9a4f05e5b23f..55f1515d54c9 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -677,8 +677,7 @@ static int __init dmar_acpi_dev_scope_init(void)
andd->object_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->object_name);
continue;