lkml.org 
[lkml]   [2020]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] leds: lp50xx: Fix an error handling path in 'lp50xx_probe_dt()'
On Wed, Sep 23, 2020 at 08:49:56PM +0200, Christophe JAILLET wrote:
> Le 23/09/2020 à 15:35, Dan Carpenter a écrit :
> > I've added Heikki Krogerus to the CC list because my question is mostly
> > about commit 59abd83672f7 ("drivers: base: Introducing software nodes to
> > the firmware node framework").
> >
> > I have been trying to teach Smatch to understand reference counting so
> > it can discover these kinds of bugs automatically.
> >
> > I don't know how software_node_get_next_child() can work when it doesn't
> > call kobject_get(). This sort of bug would have been caught in testing
> > because it affects the success path so I must be reading the code wrong.
> >
>
> I had the same reading of the code and thought that I was missing something
> somewhere.
>
> There is the same question about 'acpi_get_next_subnode' which is also a
> '.get_next_child_node' function, without any ref counting, if I'm correct.
>

Yeah, but there aren't any ->get/put() ops for the acpi_get_next_subnode()
stuff so it's not a problem. (Presumably there is some other sort of
refcounting policy there).

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-09-24 08:50    [W:0.086 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site