netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ma Ke <make24@iscas.ac.cn>, Wang Hai <wanghai26@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, jdamato@fastly.com,
	aleksander.lobakin@intel.com, quic_zijuhu@quicinc.com,
	wanghai26@huawei.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] net-sysfs: fix error handling in netdev_register_kobject()
Date: Thu, 13 Mar 2025 11:02:28 +0200	[thread overview]
Message-ID: <Z9KfJBzR9ZWFBJDf@smile.fi.intel.com> (raw)
In-Reply-To: <Z9Ke3moM5BVSsPax@smile.fi.intel.com>

+Cc: Wang Hai

On Thu, Mar 13, 2025 at 11:01:18AM +0200, Andy Shevchenko wrote:
> On Thu, Mar 13, 2025 at 03:55:28PM +0800, Ma Ke wrote:
> > Once device_add() failed, we should call put_device() to decrement
> > reference count for cleanup. Or it could cause memory leak.
> > 
> > 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'.
> 
> Okay, have you read the history of this?
> 6b70fc94afd1 ("net-sysfs: Fix memory leak in netdev_register_kobject")
> 8ed633b9baf9 ("Revert "net-sysfs: Fix memory leak in netdev_register_kobject"")
> https://syzkaller.appspot.com/x/log.txt?x=1737671b200000
> 
> TL;DR: next time provide a better changelog and clean syzkaller report.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-03-13  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  7:55 [PATCH] net-sysfs: fix error handling in netdev_register_kobject() Ma Ke
2025-03-13  9:01 ` Andy Shevchenko
2025-03-13  9:02   ` Andy Shevchenko [this message]
2025-03-13  9:58 ` Greg KH

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=Z9KfJBzR9ZWFBJDf@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_zijuhu@quicinc.com \
    --cc=stable@vger.kernel.org \
    --cc=wanghai26@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;
as well as URLs for NNTP newsgroup(s).