diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-03-25 02:56:21 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-25 15:23:14 (GMT) |
commit | 543e3a8da5a4c453e992d5351ef405d5e32f27d7 (patch) | |
tree | bc8514faff2b7548705e02d57b711d7d96843abb /kernel/bpf/syscall.c | |
parent | 7dd399130efb5a454daf24075b7563d197114e39 (diff) | |
download | linux-543e3a8da5a4c453e992d5351ef405d5e32f27d7.tar.xz |
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>
Diffstat (limited to 'kernel/bpf/syscall.c')
0 files changed, 0 insertions, 0 deletions