diff options
author | 2019-03-18 21:47:09 +0300 | |
---|---|---|
committer | 2019-04-20 09:16:56 +0200 | |
commit | 66495ebfd4dff8434b494193e78aeeeba0c5c358 (patch) | |
tree | 514356628522c9071a746d667cfe0bf00b432298 | |
parent | fd9f338db8679c4d053c2f73a0863d7309801689 (diff) | |
download | linux-yocto-66495ebfd4dff8434b494193e78aeeeba0c5c358.tar.gz linux-yocto-66495ebfd4dff8434b494193e78aeeeba0c5c358.tar.bz2 linux-yocto-66495ebfd4dff8434b494193e78aeeeba0c5c358.zip |
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>
-rw-r--r-- | drivers/acpi/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 78db97687f26..c4b06cc075f9 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); + put_device(dev); return !!dev; } EXPORT_SYMBOL(acpi_dev_present); |