diff options
| author | Vitalii Mordan <mordan@ispras.ru> | 2025-02-12 20:28:03 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-29 11:02:12 +0200 |
| commit | 477a412a2f6cc411a40d79293448a9345689e6a0 (patch) | |
| tree | f92b84fb48b8562fe0238539457bce2cac892674 /drivers/i2c | |
| parent | 3b9cf1c0fafa2cb0ca40ffd9786e1c83175bbef9 (diff) | |
| download | linux-477a412a2f6cc411a40d79293448a9345689e6a0.tar.gz linux-477a412a2f6cc411a40d79293448a9345689e6a0.tar.bz2 linux-477a412a2f6cc411a40d79293448a9345689e6a0.zip | |
i2c: pxa: fix call balance of i2c->clk handling routines
[ Upstream commit be7113d2e2a6f20cbee99c98d261a1fd6fd7b549 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 4d76e71cdd4b..afc1a8171f59 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1503,7 +1503,10 @@ 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; |
