mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
extcon: adc-jack: Cleanup wakeup source only if it was enabled
commit 92bac7d4de9c07933f6b76d8f1c7f8240f911f4f 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: 78b6a991eb6c ("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]>
This commit is contained in:
parent
9649275aee
commit
788b15a1ef
1 changed files with 2 additions and 1 deletions
|
|
@ -162,7 +162,8 @@ static int adc_jack_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct adc_jack_data *data = platform_get_drvdata(pdev);
|
||||
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
if (data->wakeup_source)
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
free_irq(data->irq, data);
|
||||
cancel_work_sync(&data->handler.work);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue