i2c: pxa: fix call balance of i2c->clk handling routines
PATCH v2 1/1 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 <[email protected]>
---
v2: Use dev_err_probe() helper function, as per Andi Shyti request.
drivers/i2c/busses/i2c-pxa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-pxa.c +5 -1
@@ -1503,7 +1503,11 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c->adap.name); } -clk_prepare_enable (i2c->clk); + ret =clk_prepare_enable (i2c->clk); +if (ret) { +return dev_err_probe (&dev->dev, ret, +"failed to enable clock\n" ); + }if (i2c->use_pio) { i2c->adap.algo = &i2c_pxa_pio_algorithm;
Signature · 1 line
2.25.1
Hi Vitalii,
Quoted 4 lines · Vitalii Mordan
If the clock
i2c->clkwas not enabled ini2c_pxa_probe(), it should not be disabled in any path.Found by Linux Verification Center (linuxtesting.org) with Klever.
here I added a blank line.
Quoted 1 line
Signed-off-by Vitalii Mordan <[email protected]>
...
drivers/i2c/busses/i2c-pxa.c static int i2c_pxa_probe(struct platform_device *dev) · line 1510
Quoted 6 lines
drivers/i2c/busses/i2c-pxa.c +5
-1-clk_prepare_enable (i2c->clk); + ret =clk_prepare_enable (i2c->clk); +if (ret) { +return dev_err_probe (&dev->dev, ret, +"failed to enable clock\n" ); + }
I removed the brackets here that are not necessary.
Merged to i2c/i2c-host.
Thanks,
Andi
Quoted 6 lines
drivers/i2c/busses/i2c-pxa.c +0
-0if (i2c->use_pio) { i2c->adap.algo = &i2c_pxa_pio_algorithm;Signature · 1 line
2.25.1