[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220727161012.595366208@linuxfoundation.org>
Date: Wed, 27 Jul 2022 18:09:59 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Edwin Peer <edwin.peer@...adcom.com>,
Jakub Kicinski <kuba@...nel.org>,
Fedor Pchelkin <pchelkin@...ras.ru>
Subject: [PATCH 5.10 013/105] net: inline rollback_registered()
From: Fedor Pchelkin <pchelkin@...ras.ru>
From: Jakub Kicinski <kuba@...nel.org>
commit 037e56bd965e1bc72c2fa9684ac25b56839a338e upstream.
rollback_registered() is a local helper, it's common for driver
code to call unregister_netdevice_queue(dev, NULL) when they
want to unregister netdevices under rtnl_lock. Inline
rollback_registered() and adjust the only remaining caller.
Reviewed-by: Edwin Peer <edwin.peer@...adcom.com>
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/core/dev.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9601,15 +9601,6 @@ static void rollback_registered_many(str
}
}
-static void rollback_registered(struct net_device *dev)
-{
- LIST_HEAD(single);
-
- list_add(&dev->unreg_list, &single);
- rollback_registered_many(&single);
- list_del(&single);
-}
-
static netdev_features_t netdev_sync_upper_features(struct net_device *lower,
struct net_device *upper, netdev_features_t features)
{
@@ -10148,7 +10139,7 @@ int register_netdevice(struct net_device
if (ret) {
/* Expect explicit free_netdev() on failure */
dev->needs_free_netdev = false;
- rollback_registered(dev);
+ unregister_netdevice_queue(dev, NULL);
goto out;
}
/*
@@ -10755,7 +10746,11 @@ void unregister_netdevice_queue(struct n
if (head) {
list_move_tail(&dev->unreg_list, head);
} else {
- rollback_registered(dev);
+ LIST_HEAD(single);
+
+ list_add(&dev->unreg_list, &single);
+ rollback_registered_many(&single);
+ list_del(&single);
}
}
EXPORT_SYMBOL(unregister_netdevice_queue);
Powered by blists - more mailing lists