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 <krzysztof.kozlowski@linaro.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-29-d66d5f39b6bf@linaro.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 972a3b4 commit 1dd6095

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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)