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: <ba408a65-9179-4868-a1ac-44b936ee778f@gmail.com>
Date: Tue, 2 Jul 2024 17:08:38 +0200
From: Javier Carrasco <javier.carrasco.cruz@...il.com>
To: Abhinav Jain <jain.abhinav177@...il.com>, p.zabel@...gutronix.de,
 airlied@...il.com, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Cc: skhan@...uxfoundation.org
Subject: Re: [PATCH] gpu: ipu-v3: Removal of of_node_put with __free for auto
 cleanup

On 02/07/2024 16:48, Abhinav Jain wrote:
> Remove of_node_put from device node of_node.
> Move declaration to initialization for ensuring scope sanity.
> 
> Signed-off-by: Abhinav Jain <jain.abhinav177@...il.com>
> ---
>  drivers/gpu/ipu-v3/ipu-common.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
> index 71ec1e7f657a..f8cc3f721d2a 100644
> --- a/drivers/gpu/ipu-v3/ipu-common.c
> +++ b/drivers/gpu/ipu-v3/ipu-common.c
> @@ -1150,10 +1150,10 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
>  	for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
>  		struct ipu_platform_reg *reg = &client_reg[i];
>  		struct platform_device *pdev;
> -		struct device_node *of_node;
> -
>  		/* Associate subdevice with the corresponding port node */
> -		of_node = of_graph_get_port_by_id(dev->of_node, i);
> +		struct device_node *of_node __free(device_node) =
> +			of_graph_get_port_by_id(dev->of_node, i);
> +
>  		if (!of_node) {
>  			dev_info(dev,
>  				 "no port@%d node in %pOF, not using %s%d\n",


Hi Abhinav,

1. You sent this patch twice.
2. The __free() macro removes the need for of_node_put(), but you kept
the calls to that function.
3. If you are aiming for a code refactoring, do not apply the __free()
macro to a single device_node, leaving the rest untouched.

Best regards,
Javier Carrasco

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ