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] [day] [month] [year] [list]
Message-ID: <66c0550553cb5d9d332d48d9fb80d4f9.sboyd@kernel.org>
Date: Tue, 27 Aug 2024 17:03:17 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: David Hunter <david.hunter.linux@...il.com>
Cc: david.hunter.linux@...il.com, javier.carrasco.cruz@...il.com, linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, mturquette@...libre.com, shuah@...nel.org
Subject: Re: [PATCH 1/1 V2] Driver: clk-qoriq.c: replace of_node_put with _free improves cleanup

The subject should be

 clk: clk-qoriq: Replace of_node_put() with __free()

Quoting David Hunter (2024-08-20 18:07:39)
> Use _free() to have automatic cleanup instead of calling of_node_put()

__free()

> manually.
> 
> Compiled without errors or warnings.
> 
> Signed-off-by: David Hunter <david.hunter.linux@...il.com>
> ---
> The following commit has information on _free(device_node):
> 9448e55d032d99af8e23487f51a542d51b2f1a48  
> 
> V1 --> V2
>         - Improved message body 
>         - Use change log to give more information about _free()

Please don't send the next version as a reply to the previous patch.

> ---
>  drivers/clk/clk-qoriq.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
> index 4dcde305944c..941a0372db4b 100644
> --- a/drivers/clk/clk-qoriq.c
> +++ b/drivers/clk/clk-qoriq.c
> @@ -1065,11 +1065,8 @@ static void __init _clockgen_init(struct device_node *np, bool legacy);
>  static void __init legacy_init_clockgen(struct device_node *np)
>  {
>         if (!clockgen.node) {
> -               struct device_node *parent_np;
> -
> -               parent_np = of_get_parent(np);
> +               struct device_node __free(device_node) *parent_np = of_get_parent(np);

It seems the __free() comes after the variable name declaration if my
grep skills are working today.

Also, please include linux/cleanup.h at the top of the file for __free().

>                 _clockgen_init(parent_np, true);
> -               of_node_put(parent_np);
>         }
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ