All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] about net: Fix inconsistent teardown and release of private netdev state.
Date: Thu, 17 Aug 2017 22:21:31 -0700 (PDT)	[thread overview]
Message-ID: <20170817.222131.548007722474107806.davem@davemloft.net> (raw)
In-Reply-To: <1503009040.4936.161.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 17 Aug 2017 15:30:40 -0700

> So we do not really know if we need to clean up or not.

We always know, the answer is that whenever register_netdev() fails we
never need to perform any cleanup which is done by priv_destructor.

> Any idea how to fix the issue ?

Your patch is exactly how we should fix this, but without the comment.
The logic is straightforward.

If register_netdevice() fails any resources handled by priv_destructor
are cleaned up, it is guaranteed.

  reply	other threads:[~2017-08-18  5:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 22:30 [RFC] about net: Fix inconsistent teardown and release of private netdev state Eric Dumazet
2017-08-18  5:21 ` David Miller [this message]
2017-08-18 13:13   ` Eric Dumazet
2017-08-18 22:58     ` David Miller
2017-08-19  3:40       ` Eric Dumazet
2017-08-21 21:13         ` David Miller
2017-08-25 14:57           ` Eric Dumazet

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=20170817.222131.548007722474107806.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.