Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: rt5033: Fix wakeup source leaks on device unbind

Device can be unbound, so driver must also release memory for the wakeup
source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250406-mfd-device-wakekup-leak-v1-7-318e14bdba0a@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
82ae581e fd37695d

+5 -1
+5 -1
drivers/mfd/rt5033.c
··· 98 98 return ret; 99 99 } 100 100 101 - device_init_wakeup(rt5033->dev, rt5033->wakeup); 101 + if (rt5033->wakeup) { 102 + ret = devm_device_init_wakeup(rt5033->dev); 103 + if (ret) 104 + return dev_err_probe(rt5033->dev, ret, "Failed to init wakeup\n"); 105 + } 102 106 103 107 return 0; 104 108 }