lkml.org 
[lkml]   [2013]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: Usage of for_each_child_of_node()
    From
    On Sat, Oct 12, 2013 at 3:54 PM, Guenter Roeck <linux@roeck-us.net> wrote:
    > Hi all,
    >
    > for_each_child_of_node() and similar functions increase the refcount
    > on each returned node and expect the caller to release the node by
    > calling of_node_put() when done.
    >
    > Looking through the kernel code, it appears this is hardly ever done,
    > if at all. Some code even calls of_node_get() on returned nodes again.
    >
    > I guess this doesn't matter in cases where devicetree is a static entity.
    > However, this is not (or no longer) the case with devicetree overlays,
    > or more generically in cases where devicetree nodes are added and
    > removed dynamically.
    >
    > Fundamental question: Would patches to fix this problem be accepted upstream
    > ?

    Certainly.

    > Or, of course, stepping a bit back: Am I missing something essential ?

    No. I think this is frequently wrong since it typically doesn't matter
    for static entries as you mention.

    Rob


    \
     
     \ /
      Last update: 2013-10-13 05:41    [W:3.355 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site