Skip to content

Commit 54e3aca

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI / utils: Drop reference in test for device presence
When commit 8661423 ("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: 8661423 ("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>
1 parent 9e98c67 commit 54e3aca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/acpi/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv)
800800
match.hrv = hrv;
801801

802802
dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
803+
put_device(dev);
803804
return !!dev;
804805
}
805806
EXPORT_SYMBOL(acpi_dev_present);

0 commit comments

Comments
 (0)