From: Krzysztof Kozlowski Date: Thu, 1 May 2025 14:33:21 +0000 (+0200) Subject: extcon: adc-jack: Fix wakeup source leaks on device unbind X-Git-Tag: v6.18-rc1~74^2~13^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78b6a991eb6c6f19ed7d0ac91cda3b3b117fda8f;p=thirdparty%2Fkernel%2Flinux.git extcon: adc-jack: Fix wakeup source leaks on device unbind 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 Signed-off-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c index 46c40d85c2ac8..557930394abd2 100644 --- a/drivers/extcon/extcon-adc-jack.c +++ b/drivers/extcon/extcon-adc-jack.c @@ -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); }