Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

extcon: adc-jack: Cleanup wakeup source only if it was enabled

Driver in the probe enables wakeup source conditionally, so the cleanup
path should do the same - do not release the wakeup source memory if it
was not allocated.

Link: https://lore.kernel.org/lkml/20250509071703.39442-2-krzysztof.kozlowski@linaro.org/
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/r/22aaebb7-553b-4571-8a43-58a523241082@wanadoo.fr/
Fixes: 78b6a991eb6c ("extcon: adc-jack: Fix wakeup source leaks on device unbind")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Krzysztof Kozlowski and committed by
Chanwoo Choi
92bac7d4 369259d5

+2 -1
+2 -1
drivers/extcon/extcon-adc-jack.c
··· 164 164 { 165 165 struct adc_jack_data *data = platform_get_drvdata(pdev); 166 166 167 - device_init_wakeup(&pdev->dev, false); 167 + if (data->wakeup_source) 168 + device_init_wakeup(&pdev->dev, false); 168 169 free_irq(data->irq, data); 169 170 cancel_work_sync(&data->handler.work); 170 171 }