Commit 92bac7d4 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Chanwoo Choi
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/r/22aaebb7-553b-4571-8a43-58a523241082@wanadoo.fr/


Fixes: 78b6a991 ("extcon: adc-jack: Fix wakeup source leaks on device unbind")
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 369259d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ static void adc_jack_remove(struct platform_device *pdev)
{
	struct adc_jack_data *data = platform_get_drvdata(pdev);

	if (data->wakeup_source)
		device_init_wakeup(&pdev->dev, false);
	free_irq(data->irq, data);
	cancel_work_sync(&data->handler.work);