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-next>] [day] [month] [year] [list]
Message-Id: <20240704132142.1003887-1-jain.abhinav177@gmail.com>
Date: Thu,  4 Jul 2024 13:21:42 +0000
From: Abhinav Jain <jain.abhinav177@...il.com>
To: p.zabel@...gutronix.de,
	airlied@...il.com,
	daniel@...ll.ch,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Cc: skhan@...uxfoundation.org,
	javier.carrasco.cruz@...il.com,
	jain.abhinav177@...il.com,
	julia.lawall@...ia.fr
Subject: [PATCH v2] gpu: ipu-v3: Add cleanup attribute for prg_node for auto cleanup

Add cleanup attribute for device node prg_node.
Remove of_node_put for device node prg_node as it is unnecessary now.

Suggested-by: Julia Lawall <julia.lawall@...ia.fr>
Signed-off-by: Abhinav Jain <jain.abhinav177@...il.com>
---
- PATCH v1:
https://lore.kernel.org/all/20240702150109.1002065-1-jain.abhinav177@gmail.com/

- Changes since v1:
  Enhanced the commit description to better suit the work being done
  as per the feedback in v1
---
 drivers/gpu/ipu-v3/ipu-prg.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
index 729605709955..d1f46bc761ec 100644
--- a/drivers/gpu/ipu-v3/ipu-prg.c
+++ b/drivers/gpu/ipu-v3/ipu-prg.c
@@ -84,8 +84,8 @@ static LIST_HEAD(ipu_prg_list);
 struct ipu_prg *
 ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
 {
-	struct device_node *prg_node = of_parse_phandle(dev->of_node,
-							name, 0);
+	struct device_node *prg_node __free(device_node) =
+		of_parse_phandle(dev->of_node, name, 0);
 	struct ipu_prg *prg;
 
 	mutex_lock(&ipu_prg_list_mutex);
@@ -95,14 +95,11 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
 			device_link_add(dev, prg->dev,
 					DL_FLAG_AUTOREMOVE_CONSUMER);
 			prg->id = ipu_id;
-			of_node_put(prg_node);
 			return prg;
 		}
 	}
 	mutex_unlock(&ipu_prg_list_mutex);
 
-	of_node_put(prg_node);
-
 	return NULL;
 }
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ