linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"emamd001@umn.edu" <emamd001@umn.edu>,
	"wu000273@umn.edu" <wu000273@umn.edu>,
	"kjlu@umn.edu" <kjlu@umn.edu>,
	"smccaman@umn.edu" <smccaman@umn.edu>
Subject: Re: [PATCH] io: pressure: zpa2326: handle pm_runtime_get_sync failure
Date: Sun, 7 Jun 2020 22:47:47 -0500	[thread overview]
Message-ID: <CAEkB2ETaiZM9aQsH8_eeBSDPzTpjSLpWSeHV1S3mMxMjM+_TyA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeRaS0JBRSyr+MeCbkVsscLyxkag00eY+pMPXZ6Jvb2zQ@mail.gmail.com>

On Sat, Jun 6, 2020 at 2:29 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
>
>
> On Saturday, June 6, 2020, Jonathan Cameron <jic23@kernel.org> wrote:
>>
>> On Thu,  4 Jun 2020 21:44:44 -0500
>> Navid Emamdoost <navid.emamdoost@gmail.com> wrote:
>>
>> > Calling pm_runtime_get_sync increments the counter even in case of
>> > failure, causing incorrect ref count. Call pm_runtime_put if
>> > pm_runtime_get_sync fails.
>> >
>> > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
>>
>> Hi Navid,
>>
>> This looks to be a fix, be it for a case that we are hopefully
>> unlikely to ever hit.  Please could you add an appropriate
>> Fixes tag so we can work out how far to backport it?
>>
>> Patch looks good to me so if you just reply with a suitable
>> tag I can add it whilst applying.

Hi Jonathan,
Here is the fixes tag:

Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")

>
>
>
> Should not be "iio: ..." in the prefix?

Yes! It should be "iio" in the patch name.


>>
>>
>> Thanks,
>>
>> Jonathan
>>
>> > ---
>> >  drivers/iio/pressure/zpa2326.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
>> > index 99dfe33ee402..245f2e2d412b 100644
>> > --- a/drivers/iio/pressure/zpa2326.c
>> > +++ b/drivers/iio/pressure/zpa2326.c
>> > @@ -664,8 +664,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev)
>> >       int err;
>> >
>> >       err = pm_runtime_get_sync(indio_dev->dev.parent);
>> > -     if (err < 0)
>> > +     if (err < 0) {
>> > +             pm_runtime_put(indio_dev->dev.parent);
>> >               return err;
>> > +     }
>> >
>> >       if (err > 0) {
>> >               /*
>>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>


-- 
Navid.

      parent reply	other threads:[~2020-06-08  3:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  2:44 [PATCH] io: pressure: zpa2326: handle pm_runtime_get_sync failure Navid Emamdoost
2020-06-06 16:11 ` Jonathan Cameron
     [not found]   ` <CAHp75VeRaS0JBRSyr+MeCbkVsscLyxkag00eY+pMPXZ6Jvb2zQ@mail.gmail.com>
2020-06-08  3:47     ` Navid Emamdoost [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=CAEkB2ETaiZM9aQsH8_eeBSDPzTpjSLpWSeHV1S3mMxMjM+_TyA@mail.gmail.com \
    --to=navid.emamdoost@gmail.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=emamd001@umn.edu \
    --cc=jic23@kernel.org \
    --cc=kjlu@umn.edu \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=smccaman@umn.edu \
    --cc=wu000273@umn.edu \
    /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).