Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: pxa: fix call balance of i2c->clk handling routines

If the clock i2c->clk was not enabled in i2c_pxa_probe(), it should not be
disabled in any path.

Found by Linux Verification Center (linuxtesting.org) with Klever.

Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250212172803.1422136-1-mordan@ispras.ru

authored by

Vitalii Mordan and committed by
Andi Shyti
be7113d2 fad3d2e3

+4 -1
+4 -1
drivers/i2c/busses/i2c-pxa.c
··· 1503 1503 i2c->adap.name); 1504 1504 } 1505 1505 1506 - clk_prepare_enable(i2c->clk); 1506 + ret = clk_prepare_enable(i2c->clk); 1507 + if (ret) 1508 + return dev_err_probe(&dev->dev, ret, 1509 + "failed to enable clock\n"); 1507 1510 1508 1511 if (i2c->use_pio) { 1509 1512 i2c->adap.algo = &i2c_pxa_pio_algorithm;