]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 19 Aug 2021 20:48:08 +0000 (22:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:15 +0000 (11:36 +0100)
commitf66cb91cd726f3d78d74b1b7fbc20eea1eeed815
tree481b0bb142d08fad3650dfff3e1311bdebc25bd7
parentf793824ca36b3b8e526bfab5e82514d9e7b88ee5
i2c: xlr: Fix a resource leak in the error handling path of 'xlr_i2c_probe()'

[ Upstream commit 7f98960c046ee1136e7096aee168eda03aef8a5d ]

A successful 'clk_prepare()' call should be balanced by a corresponding
'clk_unprepare()' call in the error handling path of the probe, as already
done in the remove function.

More specifically, 'clk_prepare_enable()' is used, but 'clk_disable()' is
also already called. So just the unprepare step has still to be done.

Update the error handling path accordingly.

Fixes: 75d31c2372e4 ("i2c: xlr: add support for Sigma Designs controller variant")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-xlr.c