All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] crypto: nx: Hold the reference returned by of_find_compatible_node
@ 2022-07-01 11:26 Liang He
  2022-07-01 11:26 ` [PATCH 2/3] arm: omap2: pm33xx-core: Fix missing of_node_put() in amx3_idle_init() Liang He
  2022-07-01 11:26 ` [PATCH 3/3] arm: omap2: prm_common: Add the refcount for new reference creation Liang He
  0 siblings, 2 replies; 5+ messages in thread
From: Liang He @ 2022-07-01 11:26 UTC (permalink / raw)
  To: tony, linux, linux-omap, windhl

In nx842_pseries_init(), we should hold the reference returned by
of_find_compatible_node() and use it to call of_node_put to keep
refcount balance.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/crypto/nx/nx-common-pseries.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c
index 7584a34ba88c..3ea334b7f820 100644
--- a/drivers/crypto/nx/nx-common-pseries.c
+++ b/drivers/crypto/nx/nx-common-pseries.c
@@ -1208,10 +1208,13 @@ static struct vio_driver nx842_vio_driver = {
 static int __init nx842_pseries_init(void)
 {
 	struct nx842_devdata *new_devdata;
+	struct device_node *np;
 	int ret;
 
-	if (!of_find_compatible_node(NULL, NULL, "ibm,compression"))
+	np = of_find_compatible_node(NULL, NULL, "ibm,compression");
+	if (!np)
 		return -ENODEV;
+	of_node_put(np);
 
 	RCU_INIT_POINTER(devdata, NULL);
 	new_devdata = kzalloc(sizeof(*new_devdata), GFP_KERNEL);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-04  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-01 11:26 [PATCH 1/3] crypto: nx: Hold the reference returned by of_find_compatible_node Liang He
2022-07-01 11:26 ` [PATCH 2/3] arm: omap2: pm33xx-core: Fix missing of_node_put() in amx3_idle_init() Liang He
2022-07-01 11:26 ` [PATCH 3/3] arm: omap2: prm_common: Add the refcount for new reference creation Liang He
2022-07-04  7:47   ` Tony Lindgren
2022-07-04  7:56     ` Liang He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.