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: <20210121151126.74627-1-bianpan2016@163.com>
Date:   Thu, 21 Jan 2021 07:11:26 -0800
From:   Pan Bian <bianpan2016@....com>
To:     Philipp Zabel <p.zabel@...gutronix.de>,
        Antoine Tenart <atenart@...nel.org>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
Cc:     linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH] reset: berlin: Put parent device node on error path

Put parent device node parent_np if there is no enough memory.

Fixes: aed6f3cadc86 ("reset: berlin: convert to a platform driver")
Signed-off-by: Pan Bian <bianpan2016@....com>
---
 drivers/reset/reset-berlin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
index 371197bbd055..cae58e40f639 100644
--- a/drivers/reset/reset-berlin.c
+++ b/drivers/reset/reset-berlin.c
@@ -72,8 +72,10 @@ static int berlin2_reset_probe(struct platform_device *pdev)
 	struct berlin_reset_priv *priv;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv)
+	if (!priv) {
+		of_node_put(parent_np);
 		return -ENOMEM;
+	}
 
 	priv->regmap = syscon_node_to_regmap(parent_np);
 	of_node_put(parent_np);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ