mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
ACPI: EC: fix use-after-free
This patch fixes a use-after-free introduced by
commit 30c08574da
(ACPI: EC: Add new query handler to list head)
Spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
c9e4172cde
commit
1544fdbc85
@ -445,9 +445,9 @@ EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler);
|
||||
|
||||
void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
|
||||
{
|
||||
struct acpi_ec_query_handler *handler;
|
||||
struct acpi_ec_query_handler *handler, *tmp;
|
||||
mutex_lock(&ec->lock);
|
||||
list_for_each_entry(handler, &ec->list, node) {
|
||||
list_for_each_entry_safe(handler, tmp, &ec->list, node) {
|
||||
if (query_bit == handler->query_bit) {
|
||||
list_del(&handler->node);
|
||||
kfree(handler);
|
||||
|
Loading…
Reference in New Issue
Block a user