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>] [day] [month] [year] [list]
Date:   Sat, 26 Sep 2020 15:55:21 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Markus Elfring <Markus.Elfring@....de>
Cc:     Tobias Jordan <kernel@...e.de>, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        Lars-Peter Clausen <lars@...afoo.de>,
        Nuno Sa <nuno.sa@...log.com>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>
Subject: Re: [PATCH] iio: temperature: ltc2983: fix leak of device node
 iterator

On Sat, 26 Sep 2020 16:45:56 +0200
Markus Elfring <Markus.Elfring@....de> wrote:

> > Thought about adding an "goto err_of_node_put" instead, but as the error
> > paths are quite divergent, I'm not sure if that wouldn't complicate
> > things.  
> 
> Please add jump targets like “e_inval” and “put_node” so that a bit of
> common exception handling code can be better reused for this function implementation.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=7c7ec3226f5f33f9c050d85ec20f18419c622ad6#n475

On this one I think readability would perhaps be hurt a little by
doing so, particular as we need to do the of_put_node in some but
not all non error paths.  

It is a close run thing between the two options however.

I considered another option of suggesting factoring out this whole
per node block, but to do that we would have to do something a bit
odd with the return value as we have 3 options.
* error
* do not parse any more children.
* continue to parse children.

So I think in this case Tobias' solution is the best one available.

Thanks,

Jonathan

> 
> Regards,
> Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ