Message ID | 1445460100-26727-6-git-send-email-Julia.Lawall@lip6.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 10/21, Julia Lawall wrote: > for_each_available_child_of_node performs an of_node_get on each iteration, > so a break out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // <smpl> > @@ > expression root,e; > local idexpression child; > @@ > > for_each_available_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > ( > return child; > | > + of_node_put(child); > ? return ...; > ) > ... > } > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- Acked-by: Stephen Boyd <sboyd@codeaurora.org>
On 21/10/15 21:41, Julia Lawall wrote: > for_each_available_child_of_node performs an of_node_get on each iteration, > so a break out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // <smpl> > @@ > expression root,e; > local idexpression child; > @@ > > for_each_available_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > ( > return child; > | > + of_node_put(child); > ? return ...; > ) > ... > } > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Thanks for the fix. Acked-by: Sudeep Holla <sudeep.holla@arm.com> PS: Since this driver is queued via arm-soc, it needs to go via them or wait for v4.4-rc1 and then queue via clk tree.
Hi Mike/Stephen, On Thu, Oct 22, 2015 at 10:21 AM, Sudeep Holla <sudeep.holla@arm.com> wrote: > > > Thanks for the fix. > > Acked-by: Sudeep Holla <sudeep.holla@arm.com> > > PS: Since this driver is queued via arm-soc, it needs to go via them or > wait for v4.4-rc1 and then queue via clk tree. > Now that the driver is in mainline, can you take this fix via clk tree for you next -rc fixes ? Regards, Sudeep
On 11/26, Sudeep Holla wrote: > Hi Mike/Stephen, > > On Thu, Oct 22, 2015 at 10:21 AM, Sudeep Holla <sudeep.holla@arm.com> wrote: > > > > > > Thanks for the fix. > > > > Acked-by: Sudeep Holla <sudeep.holla@arm.com> > > > > PS: Since this driver is queued via arm-soc, it needs to go via them or > > wait for v4.4-rc1 and then queue via clk tree. > > > > Now that the driver is in mainline, can you take this fix via clk tree for > you next -rc fixes ? > Sure.
On 10/21, Julia Lawall wrote: > for_each_available_child_of_node performs an of_node_get on each iteration, > so a break out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // <smpl> > @@ > expression root,e; > local idexpression child; > @@ > > for_each_available_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > ( > return child; > | > + of_node_put(child); > ? return ...; > ) > ... > } > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- Applied to clk-fixes
diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c index 0b501a9..cd0f272 100644 --- a/drivers/clk/clk-scpi.c +++ b/drivers/clk/clk-scpi.c @@ -292,6 +292,7 @@ static int scpi_clocks_probe(struct platform_device *pdev) ret = scpi_clk_add(dev, child, match); if (ret) { scpi_clocks_remove(pdev); + of_node_put(child); return ret; } }
for_each_available_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression root,e; local idexpression child; @@ for_each_available_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/clk/clk-scpi.c | 1 + 1 file changed, 1 insertion(+)