Skip to content

Commit 82ae581

Browse files
krzklag-linaro
authored andcommitted
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>
1 parent fd37695 commit 82ae581

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mfd/rt5033.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ static int rt5033_i2c_probe(struct i2c_client *i2c)
9898
return ret;
9999
}
100100

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+
}
102106

103107
return 0;
104108
}

0 commit comments

Comments
 (0)