From: Greg KH <gregkh@linuxfoundation.org>
To: Ma Ke <make24@iscas.ac.cn>
Cc: eajames@linux.ibm.com, ninad@linux.ibm.com, joel@jms.id.au,
jk@ozlabs.org, linux-fsi@lists.ozlabs.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
stable@vger.kernel.org
Subject: Re: [PATCH RESEND] Once cdev_device_add() failed, we should use put_device() to decrement reference count for cleanup. Or it could cause memory leak. Although operations in err_free_ida are similar to the operations in callback function fsi_slave_release(), put_device() is a correct handling operation as comments require when cdev_device_add() fails.
Date: Wed, 22 Oct 2025 10:48:44 +0200 [thread overview]
Message-ID: <2025102231-sturdily-zoom-ada1@gregkh> (raw)
In-Reply-To: <20251022083452.37409-1-make24@iscas.ac.cn>
On Wed, Oct 22, 2025 at 04:34:52PM +0800, Ma Ke wrote:
> As comment of device_add() says, 'if device_add() succeeds, you should
> call device_del() when you want to get rid of it. If device_add() has
> not succeeded, use only put_device() to drop the reference count'.
>
> Found by code review.
Your subject line looks a bit messed up :(
prev parent reply other threads:[~2025-10-22 8:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 8:34 Ma Ke
2025-10-22 8:48 ` Greg KH [this message]
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=2025102231-sturdily-zoom-ada1@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=eajames@linux.ibm.com \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--cc=linux-fsi@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=make24@iscas.ac.cn \
--cc=ninad@linux.ibm.com \
--cc=stable@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
all inboxes | Powered by JetHome®