6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang [ Upstream commit aaabefc79b0ff0018e8e3832169bbe359d0551fc ] In wmt_i2c_probe(), i2c->clk is acquired using of_clk_get(). If any subsequent operation fails or when the module is unloaded, the clock reference count is never decremented via clk_put(), leading to a resource leak. Switch to devm_clk_get() so that the clock is automatically managed and released. Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang Signed-off-by: Andi Shyti Link: https://patch.msgid.link/20260916070631.1965713-1-vulab@iscas.ac.cn [ sashal: Adapted i2c->clk to i2c_dev->clk within the existing error-handling context. ] Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-wmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c index 7d4bc87360793..a1716dddfca8e 100644 --- a/drivers/i2c/busses/i2c-wmt.c +++ b/drivers/i2c/busses/i2c-wmt.c @@ -391,7 +391,7 @@ static int wmt_i2c_probe(struct platform_device *pdev) return -EINVAL; } - i2c_dev->clk = of_clk_get(np, 0); + i2c_dev->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(i2c_dev->clk)) { dev_err(&pdev->dev, "unable to request clock\n"); return PTR_ERR(i2c_dev->clk); -- 2.53.0