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: <20211109032943.129855-1-ye.guojin@zte.com.cn>
Date:   Tue,  9 Nov 2021 03:29:43 +0000
From:   cgel.zte@...il.com
To:     f.fainelli@...il.com
Cc:     tglx@...utronix.de, maz@...nel.org,
        bcm-kernel-feedback-list@...adcom.com, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Ye Guojin <ye.guojin@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] irqchip/irq-bcm7120-l2: add put_device() after of_find_device_by_node()

From: Ye Guojin <ye.guojin@....com.cn>

This was found by coccicheck:
./drivers/irqchip/irq-bcm7120-l2.c,328,1-7,ERROR  missing put_device;
call of_find_device_by_node on line 234, but without a corresponding
object release within this function.
./drivers/irqchip/irq-bcm7120-l2.c,341,1-7,ERROR  missing put_device;
call of_find_device_by_node on line 234, but without a corresponding
object release within this function.

Addtionally, fixup the potential problem that memory is not released
before return.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Ye Guojin <ye.guojin@....com.cn>
---
 drivers/irqchip/irq-bcm7120-l2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
index d80e67a6aad2..aaa70619f3c0 100644
--- a/drivers/irqchip/irq-bcm7120-l2.c
+++ b/drivers/irqchip/irq-bcm7120-l2.c
@@ -325,7 +325,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
 	pr_info("registered %s intc (%pOF, parent IRQ(s): %d)\n",
 		intc_name, dn, data->num_parent_irqs);
 
-	return 0;
+	ret = 0;
 
 out_free_domain:
 	irq_domain_remove(data->domain);
@@ -336,6 +336,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
 		if (data->map_base[idx])
 			iounmap(data->map_base[idx]);
 	}
+	put_device(&pdev->dev);
 out_free_data:
 	kfree(data);
 	return ret;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ