lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <127231a4-f181-e172-2262-eb2604cacb0b@web.de>
Date:   Mon, 5 Aug 2019 14:30:55 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     Nishka Dasgupta <nishkadg.linux@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] regulator: core: Add of_node_put() before return

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ