netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Wang Hai <wanghai26@huawei.com>
Cc: davem@davemloft.net, idosch@mellanox.com, eric.dumazet@gmail.com,
	alexander.h.duyck@intel.com, tyhicks@canonical.com,
	f.fainelli@gmail.com, viro@zeniv.linux.org.uk,
	amritha.nambiar@intel.com, joe@perches.com,
	dmitry.torokhov@gmail.com, stephen@networkplumber.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Revert "net-sysfs: Fix memory leak in netdev_register_kobject"
Date: Fri, 12 Apr 2019 11:38:57 +0300	[thread overview]
Message-ID: <20190412083857.GH9224@smile.fi.intel.com> (raw)
In-Reply-To: <20190412203634.30392-2-wanghai26@huawei.com>

On Fri, Apr 12, 2019 at 04:36:33PM -0400, Wang Hai wrote:
> This reverts commit 6b70fc94afd165342876e53fc4b2f7d085009945.
> 
> The reverted bugfix will cause another issue.
> Reported by syzbot+6024817a931b2830bc93@syzkaller.appspotmail.com.
> See https://syzkaller.appspot.com/x/log.txt?x=1737671b200000 for
> details.
> 

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Wang Hai <wanghai26@huawei.com>
> ---
>  net/core/net-sysfs.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index f8f9430..8f8b7b6 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -1747,20 +1747,16 @@ int netdev_register_kobject(struct net_device *ndev)
>  
>  	error = device_add(dev);
>  	if (error)
> -		goto error_put_device;
> +		return error;
>  
>  	error = register_queue_kobjects(ndev);
> -	if (error)
> -		goto error_device_del;
> +	if (error) {
> +		device_del(dev);
> +		return error;
> +	}
>  
>  	pm_runtime_set_memalloc_noio(dev, true);
>  
> -	return 0;
> -
> -error_device_del:
> -	device_del(dev);
> -error_put_device:
> -	put_device(dev);
>  	return error;
>  }
>  
> -- 
> 1.8.3.1
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2019-04-12  8:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 20:36 [PATCH 0/2] net-sysfs: revert wrong bugfix and re-fix Wang Hai
2019-04-12 20:36 ` [PATCH 1/2] Revert "net-sysfs: Fix memory leak in netdev_register_kobject" Wang Hai
2019-04-12  8:38   ` Andy Shevchenko [this message]
2019-04-15 20:10   ` David Miller
2019-04-12 20:36 ` [PATCH 2/2] net-sysfs: Fix memory leak in netdev_register_kobject Wang Hai
2019-04-12  8:38   ` Andy Shevchenko
2019-04-12 12:08     ` wanghai (M)
2019-04-12 12:50       ` Al Viro
2019-04-12 13:03   ` Eric Dumazet
2019-04-12 13:20     ` Andy Shevchenko
2019-04-12 13:33       ` wanghai (M)
2019-04-12 13:28     ` wanghai (M)

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=20190412083857.GH9224@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=amritha.nambiar@intel.com \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=tyhicks@canonical.com \
    --cc=viro@zeniv.linux.org.uk \
    --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).