linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Moksh Panicker <mokshpanicker.7@gmail.com>
Cc: dlechner@baylibre.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	skhan@linuxfoundation.org
Subject: Re: [PATCH] iio: chemical: atlas-sensor: fix PM reference leak in buffer postenable
Date: Wed, 22 Jul 2026 03:04:06 +0100	[thread overview]
Message-ID: <20260722030406.00fde81d@jic23-huawei> (raw)
In-Reply-To: <20260713030046.21143-1-mokshpanicker.7@gmail.com>

On Mon, 13 Jul 2026 03:00:46 +0000
Moksh Panicker <mokshpanicker.7@gmail.com> wrote:

> atlas_buffer_postenable() acquires a runtime PM reference with
> pm_runtime_resume_and_get() but returns the result of
> atlas_set_interrupt() directly. If atlas_set_interrupt() fails,
> the runtime PM reference is leaked and the device can never
> autosuspend.
> 
> Add pm_runtime_put_autosuspend() on the error path to balance
> the reference.
> 
> Fixes: 0e4f336f50de ("iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
Hi,

I've applied this to the fixes-togreg branch of iio.git but Linus has been
pushing back on less critical fixes late in cycle so I might shuffle things
around to queue this for the next merge window instead.

Thanks

Jonathan

> ---
>  drivers/iio/chemical/atlas-sensor.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
> index 0e2edcff63f9..b2c1a598b3a5 100644
> --- a/drivers/iio/chemical/atlas-sensor.c
> +++ b/drivers/iio/chemical/atlas-sensor.c
> @@ -413,7 +413,11 @@ static int atlas_buffer_postenable(struct iio_dev *indio_dev)
>  	if (ret)
>  		return ret;
>  
> -	return atlas_set_interrupt(data, true);
> +	ret = atlas_set_interrupt(data, true);
> +	if (ret)
> +		pm_runtime_put_autosuspend(&data->client->dev);
> +
> +	return ret;
>  }
>  
>  static int atlas_buffer_predisable(struct iio_dev *indio_dev)


      reply	other threads:[~2026-07-22  2:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  3:00 [PATCH] iio: chemical: atlas-sensor: fix PM reference leak in buffer postenable Moksh Panicker
2026-07-22  2:04 ` Jonathan Cameron [this message]

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=20260722030406.00fde81d@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mokshpanicker.7@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).