public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: vigneshr@ti.com, aaro.koskinen@iki.fi, khilman@baylibre.com,
	rogerq@kernel.org, tony@atomide.com, jmkrzyszt@gmail.com,
	andi.shyti@kernel.org, miaoqinglang@huawei.com,
	grygorii.strashko@ti.com, wsa@kernel.org,
	linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] i2c: omap: Fix an error handling path in omap_i2c_probe()
Date: Fri, 18 Jul 2025 10:17:27 +0200	[thread overview]
Message-ID: <20250718101727.776611a0@akair> (raw)
In-Reply-To: <af8a9b62996bebbaaa7c02986aa2a8325ef11596.1751701715.git.christophe.jaillet@wanadoo.fr>

Am Sat,  5 Jul 2025 09:57:38 +0200
schrieb Christophe JAILLET <christophe.jaillet@wanadoo.fr>:

> If an error occurs after pm_runtime_use_autosuspend(), a corresponding
> pm_runtime_dont_use_autosuspend() should be called.
> 
> In case of error in pm_runtime_resume_and_get(), it is not the case because
> the error handling path is wrongly ordered.
> Fix it.
> 
> Fixes: 780f62974125 ("i2c: omap: fix reference leak when pm_runtime_get_sync fails")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Andreas Kemnade <andreas@kemnade.info>

> ---
> Compile tested only.
> ---
>  drivers/i2c/busses/i2c-omap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 485313d872e5..ef1193e0e62d 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1523,9 +1523,9 @@ omap_i2c_probe(struct platform_device *pdev)
>  	if (omap->mux_state)
>  		mux_state_deselect(omap->mux_state);
>  err_put_pm:
> -	pm_runtime_dont_use_autosuspend(omap->dev);
>  	pm_runtime_put_sync(omap->dev);
>  err_disable_pm:
> +	pm_runtime_dont_use_autosuspend(omap->dev);
>  	pm_runtime_disable(&pdev->dev);
>  
>  	return r;


  reply	other threads:[~2025-07-18  8:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-05  7:57 [PATCH 0/2] i2c: omap: 2 Fixes Christophe JAILLET
2025-07-05  7:57 ` [PATCH 1/2] i2c: omap: Handle omap_i2c_init() errors in omap_i2c_probe() Christophe JAILLET
2025-07-09 18:25   ` Aaro Koskinen
2025-07-09 19:03     ` Andi Shyti
2025-07-18  8:20     ` Andreas Kemnade
2025-07-05  7:57 ` [PATCH 2/2] i2c: omap: Fix an error handling path " Christophe JAILLET
2025-07-18  8:17   ` Andreas Kemnade [this message]
2025-07-09 14:02 ` [PATCH 0/2] i2c: omap: 2 Fixes Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250718101727.776611a0@akair \
    --to=andreas@kemnade.info \
    --cc=aaro.koskinen@iki.fi \
    --cc=andi.shyti@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=grygorii.strashko@ti.com \
    --cc=jmkrzyszt@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=miaoqinglang@huawei.com \
    --cc=rogerq@kernel.org \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox