Skip to content

Commit

Permalink
iommu/vt-d: Check return value of acpi_bus_get_device()
Browse files Browse the repository at this point in the history
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: ed40356
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information
Joerg Roedel committed Aug 26, 2014
1 parent c4a783b commit c0df975
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/iommu/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0df975

Please sign in to comment.