]> git.hungrycats.org Git - linux/commit
platform/x86: lenovo-yogabook: Fix work race on remove()
authorHans de Goede <hdegoede@redhat.com>
Sun, 30 Apr 2023 16:57:50 +0000 (18:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:45 +0000 (19:39 +0200)
commit7db86294ec7c1612a1c202a3539564f530001f6b
treeacdee9bb111b5a6b3c7ccc23f36064bf5873c47c
parent641516c20bfa2cd16f3aeade311bef7ee97619af
platform/x86: lenovo-yogabook: Fix work race on remove()

[ Upstream commit 9148cd2eb4450a8e9c49c8a14201fb82f651128f ]

When yogabook_wmi_remove() runs yogabook_wmi_work might still be running
and using the devices which yogabook_wmi_remove() puts.

To avoid this move to explicitly cancelling the work rather then using
devm_work_autocancel().

This requires also making the yogabook_backside_hall_irq handler non
devm managed, so that it cannot re-queue the work while
yogabook_wmi_remove() runs.

Fixes: c0549b72d99d ("platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230430165807.472798-3-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/lenovo-yogabook-wmi.c