Commit 45b03a62 authored by Joerg Roedel's avatar Joerg Roedel Committed by Greg Kroah-Hartman

iommu/vt-d: Check return value of acpi_bus_get_device()

commit c0df975f 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: ed40356b
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7e6db417
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment