Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272553

Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put

From Heiko Stübner <heiko@sntech.de>
Newsgroups linux.kernel
Subject Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put
Date 2015-11-18 21:50 +0100
Message-ID <qwhPY-84P-1@gated-at.bofh.it> (permalink)
References <qvqsh-6MZ-3@gated-at.bofh.it> <qwgTU-7l2-3@gated-at.bofh.it> <qwhGh-7Ze-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Julia,

Am Mittwoch, 18. November 2015, 21:38:02 schrieb Julia Lawall:
> On Wed, 18 Nov 2015, Heiko Stübner wrote:
> > Am Mittwoch, 18. November 2015, 11:31:29 schrieb Brian Norris:
> > > On Wed, Nov 18, 2015 at 08:27:07PM +0100, Heiko Stübner wrote:
> > > > Am Montag, 16. November 2015, 12:33:17 schrieb Julia Lawall:
> > > > hmm, while I agree that the rockchip phy has an issue in the node
> > > > lifecycle, I'm not sure that patch fixes it fully.
> > > > 
> > > > It currently iterates over each phy, but would only of_node_put the
> > > > phy it
> > > > handled last. So if an error happens on the 3rd phy, the first 2 are
> > > > already instantiated and would also get removed when the overall probe
> > > > fails, but their of_node would never be "put".
> > > 
> > > Note the behavior of of_get_next_child() (and
> > > of_get_next_available_child()); it "Decrements the refcount of prev." So
> > > the loop only keeps a reference for (at most) one node at a time.
> > > 
> > > I believe Julia's patch is correct. It's possible the commit description
> > > could have made this aspect clearer though, since I was confused about
> > > this at first as well.
> > 
> > oh, I hadn't realized that :-) .
> > 
> > Although in this case, what happens with the last child, if only "prev"s
> > get decremented? When the loop finished I'd think that the last one would
> > keep it's reference, as the patch stand right - or I'm just blind.
> 
> The loop finishes when the child is NULL.  So there is nothing to put in
> that case.  The process of getting from the last child to the NULL does
> the of_node_put.

sorry for being a bit slow today ... I should probably sleep more :-)

Then the patch looks fine ... I'll add my Tag on the top, to not burry it down 
here.


Heiko


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/7] phy: rockchip-usb: add missing of_node_put Julia Lawall <Julia.Lawall@lip6.fr> - 2015-11-16 12:50 +0100
  Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Heiko Stübner <heiko@sntech.de> - 2015-11-18 20:30 +0100
    Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Brian Norris <computersforpeace@gmail.com> - 2015-11-18 20:40 +0100
      Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Heiko Stübner <heiko@sntech.de> - 2015-11-18 20:50 +0100
        Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Julia Lawall <julia.lawall@lip6.fr> - 2015-11-18 21:40 +0100
          Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Heiko Stübner <heiko@sntech.de> - 2015-11-18 21:50 +0100
  Re: [PATCH 4/7] phy: rockchip-usb: add missing of_node_put Heiko Stübner <heiko@sntech.de> - 2015-11-18 22:50 +0100

csiph-web