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: <20220615125105.3966317-1-windhl@126.com>
Date:   Wed, 15 Jun 2022 20:51:05 +0800
From:   Liang He <windhl@....com>
To:     zbr@...emap.net, jdelvare@...e.com, linux@...ck-us.net
Cc:     linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
        windhl@....com
Subject: [PATCH] drivers: w1: Add missing of_node_put() in w1.c

In __w1_attach_slave_device, we really need not to use of_node_put
in normal path as the reference is escaped by sl. However, we need
of_node_put in the fail path before put_device.

Signed-off-by: Liang He <windhl@....com>
---
 drivers/w1/w1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index f2ae2e563dc5..44a0587105a8 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -702,6 +702,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
 		dev_err(&sl->dev,
 			"Device registration [%s] failed. err=%d\n",
 			dev_name(&sl->dev), err);
+		of_node_put(sl->dev.of_node);			
 		put_device(&sl->dev);
 		return err;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ