[PATCH] i2c: bcm2835: Fix the error handling in 'bcm2835_i2c_probe()'

Wolfram Sang wsa at kernel.org
Mon Feb 7 06:47:28 PST 2022


On Fri, Aug 20, 2021 at 08:43:33PM +0200, Christophe JAILLET wrote:
> Some resource should be released if an error occurs in
> 'bcm2835_i2c_probe()'.
> Add an error handling path and the needed 'clk_disable_unprepare()' and
> 'clk_rate_exclusive_put()' calls.
> 
> While at it, rework the bottom of the function to use this newly added
> error handling path and have an explicit and more standard "return 0;" at
> the end of the normal path.
> 
> Fixes: bebff81fb8b9 ("i2c: bcm2835: Model Divider in CCF")
> Signed-off-by: Christophe JAILLET <christophe.jaillet at wanadoo.fr>

Sadly, noone tested it but I think it is good to avoid the resource
leaks. So, rebased and applied to for-next, thanks! Please kindly check
if I rebased correctly the irq error case (once I pushed out).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220207/870b161e/attachment.sig>


More information about the linux-arm-kernel mailing list