diff options
author | 2025-04-06 21:50:09 +0200 | |
---|---|---|
committer | 2025-05-23 08:49:06 +0100 | |
commit | 6d0b2398b2638208d68ba06601f776cd5d983b75 (patch) | |
tree | 94297106325c3d1af50b2d57c9509e762406a14e | |
parent | dt-bindings: mfd: Correct indentation and style in DTS example (diff) | |
download | wireguard-linux-6d0b2398b2638208d68ba06601f776cd5d983b75.tar.xz wireguard-linux-6d0b2398b2638208d68ba06601f776cd5d983b75.zip |
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>
-rw-r--r-- | drivers/mfd/88pm886.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/88pm886.c b/drivers/mfd/88pm886.c index 891fdce5d8c1..177878aa32f8 100644 --- a/drivers/mfd/88pm886.c +++ b/drivers/mfd/88pm886.c @@ -124,7 +124,11 @@ static int pm886_probe(struct i2c_client *client) if (err) return dev_err_probe(dev, err, "Failed to register power off handler\n"); - device_init_wakeup(dev, device_property_read_bool(dev, "wakeup-source")); + if (device_property_read_bool(dev, "wakeup-source")) { + err = devm_device_init_wakeup(dev); + if (err) + return dev_err_probe(dev, err, "Failed to init wakeup\n"); + } return 0; } |