Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1364738
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() |
| Date | 2016-03-25 16:30 +0100 |
| Message-ID | <rgBQt-3Cc-1@gated-at.bofh.it> (permalink) |
| References | <rgq8F-3rj-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Bjorn Helgaas <bhelgaas@google.com> Date: Thu, 24 Mar 2016 21:56:21 -0500 > netpoll_setup() does a dev_hold() on np->dev, the netpoll device. If it > fails, it correctly does a dev_put() but leaves np->dev set. If we call > netpoll_cleanup() after the failure, np->dev is still set so we do another > dev_put(), which decrements the refcount an extra time. > > It's questionable to call netpoll_cleanup() after netpoll_setup() fails, > but it can be difficult to find the problem, and we can easily avoid it in > this case. The extra decrements can lead to hangs like this: > > unregister_netdevice: waiting for bond0 to become free. Usage count = -3 > > Set and clear np->dev at the points where we dev_hold() and dev_put() the > device. > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Looks good, applied and queued up for -stable. But you probably do want to look into the stacked device issue Neil pointed out. Thanks!
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() Bjorn Helgaas <bhelgaas@google.com> - 2016-03-25 04:00 +0100
Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() Neil Horman <nhorman@redhat.com> - 2016-03-25 12:40 +0100
Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() Bjorn Helgaas <helgaas@kernel.org> - 2016-03-25 17:50 +0100
Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() David Miller <davem@davemloft.net> - 2016-03-25 20:20 +0100
Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() Neil Horman <nhorman@redhat.com> - 2016-03-28 15:20 +0200
Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup() David Miller <davem@davemloft.net> - 2016-03-25 16:30 +0100
csiph-web