]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
extcon: adc-jack: Fix wakeup source leaks on device unbind
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 1 May 2025 14:33:21 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:15 +0000 (15:34 -0500)
[ Upstream commit 78b6a991eb6c6f19ed7d0ac91cda3b3b117fda8f ]

Device can be unbound, so driver must also release memory for the wakeup
source.  Do not use devm interface, because it would change the order of
cleanup.

Link: https://lore.kernel.org/lkml/20250501-device-wakeup-leak-extcon-v2-1-7af77802cbea@linaro.org/
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/extcon/extcon-adc-jack.c

index 125016da7fde3f095b3b425a62204fc6aa5b8690..c7b5f3f0da2efd713c0424d5bb55ad3706527ab9 100644 (file)
@@ -164,6 +164,7 @@ static void adc_jack_remove(struct platform_device *pdev)
 {
        struct adc_jack_data *data = platform_get_drvdata(pdev);
 
+       device_init_wakeup(&pdev->dev, false);
        free_irq(data->irq, data);
        cancel_work_sync(&data->handler.work);
 }