public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Eugene Zaikonnikov <ez@norphonic.com>
Cc: Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"development\@norphonic.com" <development@norphonic.com>,
	"linux-iio\@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v8 1/2] Driver for TI HDC20x0 humidity and temperature sensors
Date: Sun, 14 Jun 2020 12:31:07 +0100	[thread overview]
Message-ID: <20200614123107.474ef908@archlinux> (raw)
In-Reply-To: <863671oiwi.fsf@norphonic.com>

On Thu, 11 Jun 2020 15:02:05 +0200
Eugene Zaikonnikov <ez@norphonic.com> wrote:

> Jonathan Cameron <Jonathan.Cameron@Huawei.com> writes:
> 
> > On Mon, 18 May 2020 19:15:27 +0000
> > Eugene Zalkonnikov <ez@norphonic.com> wrote:
> >
> > Hi Eugene
> >  
> >> HDC2010/2080 driver and sysfs documentation for its heater element.
> >>   
> >
> > Would be nice to have a little more info on the device for anyone reading
> > the log after we commit this.
> >  
> Ok I'll expand the description.
> 
> > There is a potential double free in the remove path due to mix of
> > devm_iio_device_register and iio_device_unregister.
> >  
> Right, overlooked this. Will changine the unregister to the managed
> version suffice?
Whilst that would work it would be a bad idea.

You need the unmanaged unregister before disabling auto measurement
(to remove the userspace interfaces before changing things so they won't
work).

So just use unmanaged iio_device_register in probe (and reorder to
put the unregister before the sensor stop).  I think that will also
mirror the ordering in probe which should always be the case unless
there is a very good reason to do otherwise.

Jonathan



> 
> > Also, the error paths in probe don't undo the various bits of setup
> > that it feels like they should.  This might not matter in reality
> > but the code will be more obviously correct if it is fine to reset
> > the amm bit.
> >  
> I'll add that.
> 


      reply	other threads:[~2020-06-14 11:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 19:15 [PATCH v8 1/2] Driver for TI HDC20x0 humidity and temperature sensors Eugene Zalkonnikov
2020-05-18 19:22 ` [PATCH v8 2/2] Device tree bindings " Eugene Zalkonnikov
2020-05-26 18:35   ` Rob Herring
2020-07-08  8:57   ` Eugene Zaikonnikov
2020-05-19 18:11 ` [PATCH v8 1/2] Driver " Jonathan Cameron
2020-06-11 13:02   ` Eugene Zaikonnikov
2020-06-14 11:31     ` 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=20200614123107.474ef908@archlinux \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=development@norphonic.com \
    --cc=ez@norphonic.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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