summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-02-05 18:22:45 +0300
committerDavid S. Miller <davem@davemloft.net>2022-02-05 18:22:45 +0300
commit8f4f9c93c7049ad56eb6158883a8ce9857b04abe (patch)
tree7aebfd050e64400172e0ad2c456d149f35898c0e /net
parentcc3063502e0893c491ff83b61f43d402c144857d (diff)
parent4c6c11ea0f7b00a1894803efe980dfaf3b074886 (diff)
downloadlinux-8f4f9c93c7049ad56eb6158883a8ce9857b04abe.tar.xz
Merge branch 'net-dev-tracking-improvements'
Eric Dumazet says: ==================== net: device tracking improvements Main goal of this series is to be able to detect the following case which apparently is still haunting us. dev_hold_track(dev, tracker_1, GFP_ATOMIC); dev_hold(dev); dev_put(dev); dev_put(dev); // Should complain loudly here. dev_put_track(dev, tracker_1); // instead of here (as before this series) v2: third patch: I replaced the dev_put() in linkwatch_do_dev() with __dev_put(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
-rw-r--r--net/core/link_watch.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index f79744d99413..1eaa0b88e3ba 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10172,7 +10172,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
dev->pcpu_refcnt = alloc_percpu(int);
if (!dev->pcpu_refcnt)
goto free_dev;
- dev_hold(dev);
+ __dev_hold(dev);
#else
refcount_set(&dev->dev_refcnt, 1);
#endif
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index b0f5344d1185..95098d1a49bd 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -166,10 +166,10 @@ static void linkwatch_do_dev(struct net_device *dev)
netdev_state_change(dev);
}
- /* Note: our callers are responsible for
- * calling netdev_tracker_free().
+ /* Note: our callers are responsible for calling netdev_tracker_free().
+ * This is the reason we use __dev_put() instead of dev_put().
*/
- dev_put(dev);
+ __dev_put(dev);
}
static void __linkwatch_run_queue(int urgent_only)