]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: max14577: Fix wakeup source leaks on device unbind
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 6 Apr 2025 19:50:11 +0000 (21:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:36 +0000 (18:27 +0200)
[ Upstream commit d905d06e64b0eb3da43af6186c132f5282197998 ]

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-3-318e14bdba0a@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/max14577.c

index be185e9d5f16b13ec7d62a1e060a8c1ecdb9eb34..c9e56145b08bd5267fb02e454042e3be98753094 100644 (file)
@@ -467,6 +467,7 @@ static int max14577_i2c_remove(struct i2c_client *i2c)
 {
        struct max14577 *max14577 = i2c_get_clientdata(i2c);
 
+       device_init_wakeup(max14577->dev, false);
        mfd_remove_devices(max14577->dev);
        regmap_del_irq_chip(max14577->irq, max14577->irq_data);
        if (max14577->dev_type == MAXIM_DEVICE_TYPE_MAX77836)