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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: 88pm886: 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: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20250406-mfd-device-wakekup-leak-v1-1-318e14bdba0a@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
6d0b2398 54a425bd

+5 -1
+5 -1
drivers/mfd/88pm886.c
··· 124 124 if (err) 125 125 return dev_err_probe(dev, err, "Failed to register power off handler\n"); 126 126 127 - device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source")); 127 + if (device_property_read_bool(dev, "wakeup-source")) { 128 + err = devm_device_init_wakeup(dev); 129 + if (err) 130 + return dev_err_probe(dev, err, "Failed to init wakeup\n"); 131 + } 128 132 129 133 return 0; 130 134 }