[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3vpserpv2pzslwefiqxgyzg6ttjtvb73n3wnkq7k2wotszj2tl@hgxp7yh4umwc>
Date: Wed, 12 Feb 2025 18:15:07 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: Vitalii Mordan <mordan@...ras.ru>
Cc: Russell King <rmk@...-67.arm.linux.org.uk>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, Fedor Pchelkin <pchelkin@...ras.ru>,
Alexey Khoroshilov <khoroshilov@...ras.ru>, Vadim Mutilin <mutilin@...ras.ru>, lvc-project@...uxtesting.org
Subject: Re: [PATCH] i2c: pxa: fix call balance of i2c->clk handling routines
Hi Vitalii,
On Tue, Feb 11, 2025 at 05:53:21PM +0300, Vitalii Mordan wrote:
> 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.
>
> Fixes: c3cef3f3c07b ("[ARM] pxa: update pxa i2c driver to use clk support")
I'm not sure the Fixes tag is really needed here. It's not a real
bug, just a check on the return value.
> Signed-off-by: Vitalii Mordan <mordan@...ras.ru>
> ---
> drivers/i2c/busses/i2c-pxa.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index cb6988482673..4144b0ae195e 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -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) {
> + dev_err(&dev->dev, "failed to enable clock\n");
> + return ret;
can you please use dev_err_probe() here?
Thanks,
Andi
> + }
>
> if (i2c->use_pio) {
> i2c->adap.algo = &i2c_pxa_pio_algorithm;
> --
> 2.25.1
>
Powered by blists - more mailing lists