lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] regulator: core: Add of_node_put() before return
From
Date
> +++ b/drivers/regulator/core.c
> @@ -380,9 +380,12 @@ static struct device_node *of_get_child_regulator(struct device_node *parent,
>
> if (!regnode) {
> regnode = of_get_child_regulator(child, prop_name);
> - if (regnode)
> + if (regnode) {
> + of_node_put(child);
> return regnode;
> + }
> } else {
> + of_node_put(child);
> return regnode;
> }
> }

I suggest to move common exception handling code to the end of
this function implementation.
Would you like to add a jump target like “put_node”?

Regards,
Markus

\
 
 \ /
  Last update: 2019-08-05 14:33    [W:0.033 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site