[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220415135910.87598-1-hanyihao@vivo.com>
Date: Fri, 15 Apr 2022 06:59:09 -0700
From: Yihao Han <hanyihao@...o.com>
To: "David S. Miller" <davem@...emloft.net>,
Yihao Han <hanyihao@...o.com>, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: kernel@...o.com
Subject: [PATCH] sparc: kernel: Add missing put_device() calls
A coccicheck run provided information like the following.
arch/sparc/kernel/pci_sabre.c:335:2-8: ERROR: missing
put_device; call of_find_device_by_node on line 324, but
without a corresponding object release within this function.
arch/sparc/kernel/pci_sabre.c:369:0-1: ERROR: missing
put_device; call of_find_device_by_node on line 324, but
without a corresponding object release within this function.
Generated by: scripts/coccinelle/free/put_device.cocci
Signed-off-by: Yihao Han <hanyihao@...o.com>
---
arch/sparc/kernel/pci_sabre.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/sparc/kernel/pci_sabre.c b/arch/sparc/kernel/pci_sabre.c
index 3c38ca40a22b..5d0d13840ac3 100644
--- a/arch/sparc/kernel/pci_sabre.c
+++ b/arch/sparc/kernel/pci_sabre.c
@@ -331,8 +331,10 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
* 2: CE ERR
* 3: POWER FAIL
*/
- if (op->archdata.num_irqs < 4)
+ if (op->archdata.num_irqs < 4) {
+ put_device(op);
return;
+ }
/* We clear the error bits in the appropriate AFSR before
* registering the handler so that we don't get spurious
@@ -366,6 +368,7 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
tmp = upa_readq(base + SABRE_PCICTRL);
tmp |= SABRE_PCICTRL_ERREN;
upa_writeq(tmp, base + SABRE_PCICTRL);
+ put_device(op);
}
static void apb_init(struct pci_bus *sabre_bus)
--
2.17.1
Powered by blists - more mailing lists