summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2025-04-06 21:50:15 +0200
committerLee Jones <lee@kernel.org>2025-05-23 08:49:12 +0100
commit82ae581e56c36dbaee4e8da12d52018eeca01d4a (patch)
treef13c4f3507ac76c76ea1640016c475d63fed2862
parentfd37695dae093533d444237c86c3181a7339abb4 (diff)
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>
-rw-r--r--drivers/mfd/rt5033.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mfd/rt5033.c b/drivers/mfd/rt5033.c
index 84ebc96f58e4..2204bf1c5a51 100644
--- a/drivers/mfd/rt5033.c
+++ b/drivers/mfd/rt5033.c
@@ -98,7 +98,11 @@ static int rt5033_i2c_probe(struct i2c_client *i2c)
return ret;
}
- device_init_wakeup(rt5033->dev, rt5033->wakeup);
+ if (rt5033->wakeup) {
+ ret = devm_device_init_wakeup(rt5033->dev);
+ if (ret)
+ return dev_err_probe(rt5033->dev, ret, "Failed to init wakeup\n");
+ }
return 0;
}