ACPI / utils: Drop reference in test for device presence
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 18 Mar 2019 18:47:09 +0000 (21:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:15:58 +0000 (09:15 +0200)
commit19302c51c0431830127a12a637794a3dc02a3a44
treeecf806664495ee5f37806ff2086345ff93fcd7aa
parent00059edd31214370dead0578cd264d2e54c0778c
ACPI / utils: Drop reference in test for device presence

[ Upstream commit 54e3aca84e571559915998aa6cc05e5ac37c043b ]

When commit 8661423eea1a ("ACPI / utils: Add new acpi_dev_present
helper") introduced acpi_dev_present(), it missed the fact that
bus_find_device() took a reference on the device found by it and
the callers of acpi_dev_present() don't drop that reference.

Drop the reference on the device in acpi_dev_present().

Fixes: 8661423eea1a ("ACPI / utils: Add new acpi_dev_present helper")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/utils.c