lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220923160937.1912-2-claudiajkang@gmail.com>
Date:   Sat, 24 Sep 2022 01:09:36 +0900
From:   Juhee Kang <claudiajkang@...il.com>
To:     netdev@...r.kernel.org, simon.horman@...igine.com, kuba@...nel.org,
        davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com
Cc:     skhan@...uxfoundation.org, Juhee Kang <claudiajkang@...il.com>
Subject: [PATCH net-next 2/3] ethtool: use netdev_unregistering instead of open code

The open code is defined as a helper function(netdev_unregistering)
on netdev.h, which the open code is dev->reg_state == NETREG_UNREGISTERING.
Thus, netdev_unregistering() replaces the open code. This patch doesn't
change logic.

Signed-off-by: Juhee Kang <claudiajkang@...il.com>
---
 net/ethtool/netlink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index f4e41a6e0163..835b13264b15 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -40,8 +40,7 @@ int ethnl_ops_begin(struct net_device *dev)
 	if (dev->dev.parent)
 		pm_runtime_get_sync(dev->dev.parent);
 
-	if (!netif_device_present(dev) ||
-	    dev->reg_state == NETREG_UNREGISTERING) {
+	if (!netif_device_present(dev) || netdev_unregistering(dev)) {
 		ret = -ENODEV;
 		goto err;
 	}
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ