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: <1650509529-27525-1-git-send-email-baihaowen@meizu.com>
Date:   Thu, 21 Apr 2022 10:52:08 +0800
From:   Haowen Bai <baihaowen@...zu.com>
To:     Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>
CC:     Haowen Bai <baihaowen@...zu.com>, <linuxppc-dev@...ts.ozlabs.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] powerpc/pci: Remove useless null check before call of_node_put()

No need to add null check before call of_node_put(), since the
implementation of of_node_put() has done it.

Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
 arch/powerpc/kernel/pci_dn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 61571ae23953..ba3bbc9bec2d 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -357,8 +357,8 @@ void pci_remove_device_node_info(struct device_node *dn)
 
 	/* Drop the parent pci_dn's ref to our backing dt node */
 	parent = of_get_parent(dn);
-	if (parent)
-		of_node_put(parent);
+
+	of_node_put(parent);
 
 	/*
 	 * At this point we *might* still have a pci_dev that was
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ