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]
Message-Id: <20240521173857.1080030-1-pvkumar5749404@gmail.com>
Date: Tue, 21 May 2024 23:08:57 +0530
From: Prabhav Kumar Vaish <pvkumar5749404@...il.com>
To: nicolas.ferre@...rochip.com,
	alexandre.belloni@...tlin.com,
	claudiu.beznea@...on.dev
Cc: linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	julia.lawall@...ia.fr,
	javier.carrasco@...fvision.net,
	skhan@...uxfoundation.org,
	Prabhav Kumar Vaish <pvkumar5749404@...il.com>
Subject: [PATCH] drivers: soc: atmel: Automated Cleanup using __free()

Using automated cleanup to replace of_node_put() handling
allows for a simplified flow to enable direct returns on errors.

Signed-off-by: Prabhav Kumar Vaish <pvkumar5749404@...il.com>
---
 drivers/soc/atmel/soc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c
index cc9a3e107479..8c7fe37b4f21 100644
--- a/drivers/soc/atmel/soc.c
+++ b/drivers/soc/atmel/soc.c
@@ -250,7 +250,7 @@ static const struct at91_soc socs[] __initconst = {
 
 static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid)
 {
-	struct device_node *np;
+	struct device_node *np __free(device_node);
 	void __iomem *regs;
 
 	np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-dbgu");
@@ -261,7 +261,6 @@ static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid)
 		return -ENODEV;
 
 	regs = of_iomap(np, 0);
-	of_node_put(np);
 
 	if (!regs) {
 		pr_warn("Could not map DBGU iomem range");
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ