Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54e3aca8 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Rafael J. Wysocki
Browse files

ACPI / utils: Drop reference in test for device presence



When commit 8661423e ("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: 8661423e ("ACPI / utils: Add new acpi_dev_present helper")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9e98c678
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv)
	match.hrv = hrv;
	match.hrv = hrv;


	dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
	dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
	put_device(dev);
	return !!dev;
	return !!dev;
}
}
EXPORT_SYMBOL(acpi_dev_present);
EXPORT_SYMBOL(acpi_dev_present);