Re: [PATCH] regulator: core: Add of_node_put() before return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +++ 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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux