Skip to content

Commit 3694a61

Browse files
krzkgregkh
authored andcommitted
extcon: adc-jack: Cleanup wakeup source only if it was enabled
commit 92bac7d upstream. 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/[email protected]/ Reported-by: Christophe JAILLET <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 78b6a99 ("extcon: adc-jack: Fix wakeup source leaks on device unbind") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d3eaf10 commit 3694a61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/extcon/extcon-adc-jack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ static int adc_jack_remove(struct platform_device *pdev)
162162
{
163163
struct adc_jack_data *data = platform_get_drvdata(pdev);
164164

165-
device_init_wakeup(&pdev->dev, false);
165+
if (data->wakeup_source)
166+
device_init_wakeup(&pdev->dev, false);
166167
free_irq(data->irq, data);
167168
cancel_work_sync(&data->handler.work);
168169

0 commit comments

Comments
 (0)