public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] floppy:ERROR: missing put_device; call of_find_device_by_node on line 589, but without a corresponding object release within this function. Add the put_device function before return to release memory
       [not found] <tencent_0C9506095848D9427102ED415071D0F3420A@qq.com>
@ 2023-07-14  4:56 ` liubin001
  2023-07-14  6:06   ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: liubin001 @ 2023-07-14  4:56 UTC (permalink / raw)
  To: davem; +Cc: sparclinux, linux-kernel

Signed-off-by: LiuBin <liubin001@208suo.com>
---
  arch/sparc/include/asm/floppy_64.h | 1 +
  1 file changed, 1 insertion(+)

diff --git a/arch/sparc/include/asm/floppy_64.h 
b/arch/sparc/include/asm/floppy_64.h
index 070c8c1f5c8f..c4c51f494f25 100644
--- a/arch/sparc/include/asm/floppy_64.h
+++ b/arch/sparc/include/asm/floppy_64.h
@@ -588,6 +588,7 @@ static unsigned long __init sun_floppy_init(void)

          op = of_find_device_by_node(dp);
          if (!op)
+            put_device(op);
              return 0;

          state_prop = of_get_property(op->dev.of_node, "status", NULL);

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

* Re: [PATCH] floppy:ERROR: missing put_device; call of_find_device_by_node on line 589, but without a corresponding object release within this function. Add the put_device function before return to release memory
  2023-07-14  4:56 ` [PATCH] floppy:ERROR: missing put_device; call of_find_device_by_node on line 589, but without a corresponding object release within this function. Add the put_device function before return to release memory liubin001
@ 2023-07-14  6:06   ` Sam Ravnborg
  2023-07-14  6:47     ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2023-07-14  6:06 UTC (permalink / raw)
  To: liubin001; +Cc: davem, sparclinux, linux-kernel

Hi LiuBin

On Fri, Jul 14, 2023 at 12:56:29PM +0800, liubin001@208suo.com wrote:
> Signed-off-by: LiuBin <liubin001@208suo.com>
> ---
>  arch/sparc/include/asm/floppy_64.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/sparc/include/asm/floppy_64.h
> b/arch/sparc/include/asm/floppy_64.h
> index 070c8c1f5c8f..c4c51f494f25 100644
> --- a/arch/sparc/include/asm/floppy_64.h
> +++ b/arch/sparc/include/asm/floppy_64.h
> @@ -588,6 +588,7 @@ static unsigned long __init sun_floppy_init(void)
> 
>          op = of_find_device_by_node(dp);
>          if (!op)
> +            put_device(op);
>              return 0;

This does not look right as the code will always return 0 now,
independent on the if test. You missed a set of curly braces.

	Sam

> 
>          state_prop = of_get_property(op->dev.of_node, "status", NULL);

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

* Re: [PATCH] floppy:ERROR: missing put_device; call of_find_device_by_node on line 589, but without a corresponding object release within this function. Add the put_device function before return to release memory
  2023-07-14  6:06   ` Sam Ravnborg
@ 2023-07-14  6:47     ` Sam Ravnborg
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2023-07-14  6:47 UTC (permalink / raw)
  To: liubin001; +Cc: davem, sparclinux, linux-kernel

Hi LiuBin.

On Fri, Jul 14, 2023 at 08:06:55AM +0200, Sam Ravnborg wrote:
> Hi LiuBin
> 
> On Fri, Jul 14, 2023 at 12:56:29PM +0800, liubin001@208suo.com wrote:
> > Signed-off-by: LiuBin <liubin001@208suo.com>
> > ---
> >  arch/sparc/include/asm/floppy_64.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/sparc/include/asm/floppy_64.h
> > b/arch/sparc/include/asm/floppy_64.h
> > index 070c8c1f5c8f..c4c51f494f25 100644
> > --- a/arch/sparc/include/asm/floppy_64.h
> > +++ b/arch/sparc/include/asm/floppy_64.h
> > @@ -588,6 +588,7 @@ static unsigned long __init sun_floppy_init(void)
> > 
> >          op = of_find_device_by_node(dp);
> >          if (!op)
> > +            put_device(op);
> >              return 0;
> 
> This does not look right as the code will always return 0 now,
> independent on the if test. You missed a set of curly braces.

Two more notes.
Please put the description of the fix in the body of the mail.
Right now it is a very long subject - and we try to keep subject shorter
than ~70 chars.

> > Signed-off-by: LiuBin <liubin001@208suo.com>
You are expected to sign-off the patch with you name and not a nickname.
If LiuBin is indeed you name then sorry and ignore this comment.

I look forward to the updated patch.

	Sam

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

end of thread, other threads:[~2023-07-14  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <tencent_0C9506095848D9427102ED415071D0F3420A@qq.com>
2023-07-14  4:56 ` [PATCH] floppy:ERROR: missing put_device; call of_find_device_by_node on line 589, but without a corresponding object release within this function. Add the put_device function before return to release memory liubin001
2023-07-14  6:06   ` Sam Ravnborg
2023-07-14  6:47     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox