From: Jonathan Cameron <jic23@kernel.org>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
Cc: "Sa, Nuno" <Nuno.Sa@analog.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
"lars@metafoo.de" <lars@metafoo.de>,
"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
"knaack.h@gmx.de" <knaack.h@gmx.de>
Subject: Re: [PATCH 1/2] iio: adc: adi-axi-adc: Fix object reference counting
Date: Sat, 4 Jul 2020 17:06:05 +0100 [thread overview]
Message-ID: <20200704170605.20657b71@archlinux> (raw)
In-Reply-To: <8f297dda580043fc5a9c5bae53139c8aa74dd666.camel@analog.com>
On Wed, 1 Jul 2020 14:07:05 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:
> On Wed, 2020-07-01 at 14:04 +0200, Nuno Sá wrote:
> > [External]
> >
> > When looking for a registered client to attach with, the wrong reference
> > counters are being grabbed. The idea is to increment the module and
> > device
> > counters of the client device and not the counters of the axi device
> > being
> > probed.
> >
>
> Yep.
> Good catch here.
>
> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the fixes-togreg branch of iio.git
Thanks,
Jonathan
>
> > Fixes: ef04070692a2 (iio: adc: adi-axi-adc: add support for AXI ADC IP
> > core)
> >
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > ---
> > drivers/iio/adc/adi-axi-adc.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-
> > adc.c
> > index 63d926e86798..86b6b65916ee 100644
> > --- a/drivers/iio/adc/adi-axi-adc.c
> > +++ b/drivers/iio/adc/adi-axi-adc.c
> > @@ -332,12 +332,12 @@ static struct adi_axi_adc_client
> > *adi_axi_adc_attach_client(struct device *dev)
> > if (cl->dev->of_node != cln)
> > continue;
> >
> > - if (!try_module_get(dev->driver->owner)) {
> > + if (!try_module_get(cl->dev->driver->owner)) {
> > mutex_unlock(®istered_clients_lock);
> > return ERR_PTR(-ENODEV);
> > }
> >
> > - get_device(dev);
> > + get_device(cl->dev);
> > cl->info = info;
> > mutex_unlock(®istered_clients_lock);
> > return cl;
prev parent reply other threads:[~2020-07-04 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 12:04 [PATCH 1/2] iio: adc: adi-axi-adc: Fix object reference counting Nuno Sá
2020-07-01 12:04 ` [PATCH 2/2] iio: adc: adi-axi-adc: Remove unneeded check Nuno Sá
2020-07-01 13:57 ` Ardelean, Alexandru
2020-07-01 14:07 ` [PATCH 1/2] iio: adc: adi-axi-adc: Fix object reference counting Ardelean, Alexandru
2020-07-04 16:06 ` 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=20200704170605.20657b71@archlinux \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=alexandru.Ardelean@analog.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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