This is a note to let you know that I've just added the patch titled i2c: wmt: Fix an error handling path in wmt_i2c_probe() to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: i2c-wmt-fix-an-error-handling-path-in-wmt_i2c_probe.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1c3cbaaa32ff442515bdb6a96a76689d5eb2b632 Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Date: Fri Jan 5 15:39:35 2024 +0100 i2c: wmt: Fix an error handling path in wmt_i2c_probe() [ Upstream commit 97fd62e3269d2d47cefd421ffe144f9eafab8315 ] wmt_i2c_reset_hardware() calls clk_prepare_enable(). So, should an error occur after it, it should be undone by a corresponding clk_disable_unprepare() call, as already done in the remove function. Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs") Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> Signed-off-by: Andi Shyti <andi.shyti@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c index fbd0fd59f3123..f0ffd856a9c9f 100644 --- a/drivers/i2c/busses/i2c-wmt.c +++ b/drivers/i2c/busses/i2c-wmt.c @@ -433,11 +433,15 @@ static int wmt_i2c_probe(struct platform_device *pdev) err = i2c_add_adapter(adap); if (err) - return err; + goto err_disable_clk; platform_set_drvdata(pdev, i2c_dev); return 0; + +err_disable_clk: + clk_disable_unprepare(i2c_dev->clk); + return err; } static int wmt_i2c_remove(struct platform_device *pdev)