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: <1529135396-16728-1-git-send-email-hofrat@osadl.org>
Date:   Sat, 16 Jun 2018 09:49:56 +0200
From:   Nicholas Mc Guire <hofrat@...dl.org>
To:     Ralf Baechle <ralf@...ux-mips.org>
Cc:     Paul Burton <paul.burton@...s.com>,
        James Hogan <jhogan@...nel.org>,
        "Steven J. Hill" <steven.hill@...ium.com>,
        linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org,
        Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH] MIPS: Octeon: add missing of_node_put()

 The call to of_find_node_by_name inside the do-while-loop is returning
node with refcount incremented thus it must be explicitly decremented
here after usage.

Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
commit 93e502b3c2d4 ("MIPS: OCTEON: Platform support for OCTEON III USB controller")
---
Problem located by an experimental coccinelle script

Patch was compile tested with: cavium_octeon_defconfig (implies
CONFIG_USB=y)
(with a number of sparse warnings - not related to the proposed change)

Patch is against 4.17.0 (localversion-next is next-20180614)

 arch/mips/cavium-octeon/octeon-usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index bfdfaf3..76e06b4 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -512,6 +512,7 @@ static int __init dwc3_octeon_device_init(void)
 
 		if (of_device_is_compatible(node, compat_node_name)) {
 			pdev = of_find_device_by_node(node);
+			of_node_put(node);
 			if (!pdev)
 				return -ENODEV;
 
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ