All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips: ralink: fix a refcount leak in ill_acc_of_setup()
@ 2022-02-28  7:35 Hangyu Hua
  2022-03-01 16:29 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Hangyu Hua @ 2022-02-28  7:35 UTC (permalink / raw)
  To: john, tsbogend; +Cc: linux-mips, linux-kernel, Hangyu Hua

of_node_put(np) needs to be called when pdev == NULL.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 arch/mips/ralink/ill_acc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c
index 115a69fc20ca..f395ae218470 100644
--- a/arch/mips/ralink/ill_acc.c
+++ b/arch/mips/ralink/ill_acc.c
@@ -61,6 +61,7 @@ static int __init ill_acc_of_setup(void)
 	pdev = of_find_device_by_node(np);
 	if (!pdev) {
 		pr_err("%pOFn: failed to lookup pdev\n", np);
+		of_node_put(np);
 		return -EINVAL;
 	}
 
-- 
2.25.1


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

* Re: [PATCH] mips: ralink: fix a refcount leak in ill_acc_of_setup()
  2022-02-28  7:35 [PATCH] mips: ralink: fix a refcount leak in ill_acc_of_setup() Hangyu Hua
@ 2022-03-01 16:29 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-03-01 16:29 UTC (permalink / raw)
  To: Hangyu Hua; +Cc: john, linux-mips, linux-kernel

On Mon, Feb 28, 2022 at 03:35:37PM +0800, Hangyu Hua wrote:
> of_node_put(np) needs to be called when pdev == NULL.
> 
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
>  arch/mips/ralink/ill_acc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c
> index 115a69fc20ca..f395ae218470 100644
> --- a/arch/mips/ralink/ill_acc.c
> +++ b/arch/mips/ralink/ill_acc.c
> @@ -61,6 +61,7 @@ static int __init ill_acc_of_setup(void)
>  	pdev = of_find_device_by_node(np);
>  	if (!pdev) {
>  		pr_err("%pOFn: failed to lookup pdev\n", np);
> +		of_node_put(np);
>  		return -EINVAL;
>  	}
>  
> -- 
> 2.25.1

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2022-03-01 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28  7:35 [PATCH] mips: ralink: fix a refcount leak in ill_acc_of_setup() Hangyu Hua
2022-03-01 16:29 ` Thomas Bogendoerfer

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.