]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: EC: Reference count query handlers under lock
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Dec 2019 10:04:21 +0000 (11:04 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Dec 2019 10:04:21 +0000 (11:04 +0100)
commitc5330f9328ae1b03641d5edece248e5845e73648
tree1059c7bd9be1c08fa5ffc7d058613c47de7df0c7
parent75e273687aee789166c077bbe05d67c0252abf3f
ACPI: EC: Reference count query handlers under lock

There is a race condition in acpi_ec_get_query_handler()
theoretically allowing query handlers to go away before refernce
counting them.

In order to avoid it, call kref_get() on query handlers under
ec->mutex.

Also simplify the code a bit while at it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c