public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: liubin001@208suo.com
Cc: davem@davemloft.net, sparclinux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: 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
Date: Fri, 14 Jul 2023 08:06:55 +0200	[thread overview]
Message-ID: <20230714060655.GA50441@ravnborg.org> (raw)
In-Reply-To: <0f4dc280605c4700556d88d6f59cd1c4@208suo.com>

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);

  reply	other threads:[~2023-07-14  6:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2023-07-14  6:47     ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230714060655.GA50441@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubin001@208suo.com \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox