Re: [PATCH v1] ACPI / utils: Drop reference in test for device presence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 18-03-19 19:47, Andy Shevchenko wrote:
When the commit 8661423eea1a

     ("ACPI / utils: Add new acpi_dev_present helper")

introduced new helper, it misses the fact that bus_find_device() takes
a reference on the found device and callers haven't release it back.

Drop the reference on the device in test for presence.

Fixes: 8661423eea1a ("ACPI / utils: Add new acpi_dev_present helper")
Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>

Regards,

Hans


---
  drivers/acpi/utils.c | 1 +
  1 file changed, 1 insertion(+)

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);




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux