diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-03-18 14:47:09 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-03-19 17:34:21 -0400 |
| commit | 54e3aca84e571559915998aa6cc05e5ac37c043b (patch) | |
| tree | 61c10f3669a9cd1066856d73187467eb12a9e87d | |
| parent | 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff) | |
ACPI / utils: Drop reference in test for device presence
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>
| -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) | |||
| 800 | match.hrv = hrv; | 800 | match.hrv = hrv; |
| 801 | 801 | ||
| 802 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); | 802 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); |
| 803 | put_device(dev); | ||
| 803 | return !!dev; | 804 | return !!dev; |
| 804 | } | 805 | } |
| 805 | EXPORT_SYMBOL(acpi_dev_present); | 806 | EXPORT_SYMBOL(acpi_dev_present); |
