Bjorn Helgaas 543e3a8da5 netpoll: Fix extra refcount release in netpoll_cleanup()
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-25 11:23:14 -04:00
..
2016-03-01 16:07:29 -05:00
2016-02-16 20:21:48 -05:00
2015-04-02 14:04:59 -04:00
2016-02-21 22:00:28 -05:00
2015-05-17 23:41:11 -04:00
2015-11-22 11:54:10 -05:00
2016-02-09 04:28:06 -05:00
2015-10-26 22:24:22 -07:00
2015-10-08 05:26:35 -07:00