Skip to content

Commit 1dd6095

Browse files
andredalexandrebelloni
authored andcommitted
rtc: s5m: switch to devm_device_init_wakeup
To release memory allocated by device_init_wakeup(true), drivers have to call device_init_wakeup(false) in error paths and unbind. Switch to the new devres managed version devm_device_init_wakeup() to plug this memleak. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: André Draszik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 972a3b4 commit 1dd6095

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/rtc/rtc-s5m.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,11 @@ static int s5m_rtc_probe(struct platform_device *pdev)
779779
return dev_err_probe(&pdev->dev, ret,
780780
"Failed to request alarm IRQ %d\n",
781781
info->irq);
782-
device_init_wakeup(&pdev->dev, true);
782+
783+
ret = devm_device_init_wakeup(&pdev->dev);
784+
if (ret < 0)
785+
return dev_err_probe(&pdev->dev, ret,
786+
"Failed to init wakeup\n");
783787
}
784788

785789
if (of_device_is_system_power_controller(pdev->dev.parent->of_node) &&

0 commit comments

Comments
 (0)