All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Richard Weinberger" <richard@nod.at>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	stable@vger.kernel.org, "Marek Vasut" <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org,
	"Brian Norris" <computersforpeace@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: partitions: fix of_node_get/put balance in parser
Date: Mon, 17 Sep 2018 16:24:02 +0200	[thread overview]
Message-ID: <20180917162402.10cc8994@bbrezillon> (raw)
In-Reply-To: <20180917160318.37afd433@xps13>

On Mon, 17 Sep 2018 16:03:18 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon@bootlin.com> wrote on Mon, 17 Sep 2018
> 15:51:40 +0200:
> 
> > On Mon, 17 Sep 2018 11:55:20 +0200
> > Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >   
> > > > Or you just say that mtd_get_of_node() does not retain a reference to
> > > > the device_node object it returns and that should be enough ;-).      
> > > 
> > > Fine by me, you can apply it and modify in place.    
> > 
> > Here is the new commit message:
> > 
> > "
> > mtd: partitions: fix unbalanced of_node_get/put()
> > 
> > While at first mtd_part_of_parse() would just call
> > of_get_chil_by_name(), it has been patched to deal with sub-partitions
> > and will now directly manipulate the node returned mtd_get_of_node() if  
> 
>                                                     ^by
> 
> > the MTD device is a partition.
> > 
> > A of_node_put() was a bit below in the code, to balance the
> > of_get_child_by_name(). However, despite its name, mtd_get_of_node()
> > does not take a reference on the OF node. It is a simple helper
> > hiding some pointer logic to retrieve the OF node related to an MTD
> > device.
> >     
> > The direct effect of such unbalanced reference counting is visible
> > by rmmod'ing any module that would have added MTD partitions:
> > 
> > 	OF: ERROR: Bad of_node_put() on <of_path_to_partition>
> > 
> > As it seems normal to get a reference on the OF node during the
> > of_property_for_each_string() that follows, add a call to
> > of_node_get() when relevant.
> >     
> > Fixes: 76a832254ab0 ("mtd: partitions: use DT info for parsing partitions with "compatible" prop")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> > "
> > 
> > Let me know if you're okay with this update.  
> 
> One missing work, otherwise I'm ok.

Fixed and pushed.

Thanks,

Boris

      reply	other threads:[~2018-09-17 14:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 14:35 [PATCH] mtd: partitions: fix of_node_get/put balance in parser Miquel Raynal
2018-09-07 14:38 ` Miquel Raynal
2018-09-10 12:53   ` Boris Brezillon
2018-09-10 13:14     ` Miquel Raynal
2018-09-10 13:25       ` Boris Brezillon
2018-09-10 13:32         ` Boris Brezillon
2018-09-10 13:38         ` Miquel Raynal
2018-09-10 13:42           ` Boris Brezillon
2018-09-17  9:55             ` Miquel Raynal
2018-09-17 13:51               ` Boris Brezillon
2018-09-17 14:03                 ` Miquel Raynal
2018-09-17 14:24                   ` Boris Brezillon [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=20180917162402.10cc8994@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.