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

mfd: sprd-sc27xx: 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>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250406-mfd-device-wakekup-leak-v1-8-318e14bdba0a@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
37ef4aa4 82ae581e

+4 -1
+4 -1
drivers/mfd/sprd-sc27xx-spi.c
··· 210 210 return ret; 211 211 } 212 212 213 - device_init_wakeup(&spi->dev, true); 213 + ret = devm_device_init_wakeup(&spi->dev); 214 + if (ret) 215 + return dev_err_probe(&spi->dev, ret, "Failed to init wakeup\n"); 216 + 214 217 return 0; 215 218 } 216 219