public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org, rafael@kernel.org
Subject: Re: [PATCH] kobject: fix possible memory leak in kset_create_and_add()
Date: Mon, 17 Oct 2022 11:08:08 +0200	[thread overview]
Message-ID: <Y00beLWxbp1ODaB/@kroah.com> (raw)
In-Reply-To: <3a661911-fb26-3d36-a78b-0778c0fceec2@huawei.com>

On Mon, Oct 17, 2022 at 05:01:04PM +0800, Yang Yingliang wrote:
> 
> On 2022/10/17 16:49, Greg KH wrote:
> > On Mon, Oct 17, 2022 at 04:13:03PM +0800, Yang Yingliang wrote:
> > > Hi,
> > > 
> > > On 2022/10/17 12:51, Greg KH wrote:
> > > > On Mon, Oct 17, 2022 at 10:33:27AM +0800, Yang Yingliang wrote:
> > > > > If kset_register() fails in kset_create_and_add(), the name allocated
> > > > > in kset_create() will be leaked.
> > > > How is kset_create_and_add() failing?  Is this in a real kernel, or
> > > > created with a fake fault injection?
> > > Inject fault while probing module qemu_fw_cfg, kset_create_and_add() may
> > > fail.
> > Ah good, it's never being hit in a real situation.  The next time you
> > submit patches that are found like this, please include this type of
> > information.
> OK. Do I need to send a v2 with commit message update.

That would be wonderful for you to do, thank you!

Also do the same thing for the other patches you sent that fix up error
paths like this.

thanks,

greg k-h

      reply	other threads:[~2022-10-17  9:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  2:33 [PATCH] kobject: fix possible memory leak in kset_create_and_add() Yang Yingliang
2022-10-17  4:51 ` Greg KH
2022-10-17  8:13   ` Yang Yingliang
2022-10-17  8:49     ` Greg KH
2022-10-17  9:01       ` Yang Yingliang
2022-10-17  9:08         ` 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=Y00beLWxbp1ODaB/@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=yangyingliang@huawei.com \
    /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