summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/core/netpoll.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index c3c7b27c112d..fc75c9e461b8 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -1284,15 +1284,14 @@ EXPORT_SYMBOL_GPL(__netpoll_free_async);
void netpoll_cleanup(struct netpoll *np)
{
- if (!np->dev)
- return;
-
rtnl_lock();
+ if (!np->dev)
+ goto out;
__netpoll_cleanup(np);
- rtnl_unlock();
-
dev_put(np->dev);
np->dev = NULL;
+out:
+ rtnl_unlock();
}
EXPORT_SYMBOL(netpoll_cleanup);