summaryrefslogtreecommitdiff
path: root/net/core/netdev-genl.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-04-24 11:14:16 -0700
committerJakub Kicinski <kuba@kernel.org>2025-04-24 11:20:52 -0700
commit5565acd1e6c4a1994e0ba32281ec10b69c0be14d (patch)
tree2856eea8e8fd624c9f8e29068ef24b65c663b074 /net/core/netdev-genl.c
parentbef4f1156b74721b7d111114538659031119b6f2 (diff)
parent087a9eb9e5978e3ba362e1163691e41097e8ca20 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.15-rc4). This pull includes wireless and a fix to vxlan which isn't in Linus's tree just yet. The latter creates with a silent conflict / build breakage, so merging it now to avoid causing problems. drivers/net/vxlan/vxlan_vnifilter.c 094adad91310 ("vxlan: Use a single lock to protect the FDB table") 087a9eb9e597 ("vxlan: vnifilter: Fix unlocked deletion of default FDB entry") https://lore.kernel.org/20250423145131.513029-1-idosch@nvidia.com No "normal" conflicts, or adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/netdev-genl.c')
-rw-r--r--net/core/netdev-genl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 2c104947d224..2a1a399fc15d 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -860,14 +860,17 @@ int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info)
mutex_lock(&priv->lock);
+ err = 0;
netdev = netdev_get_by_index_lock(genl_info_net(info), ifindex);
- if (!netdev || !netif_device_present(netdev)) {
+ if (!netdev) {
err = -ENODEV;
goto err_unlock_sock;
}
-
- if (!netdev_need_ops_lock(netdev)) {
+ if (!netif_device_present(netdev))
+ err = -ENODEV;
+ else if (!netdev_need_ops_lock(netdev))
err = -EOPNOTSUPP;
+ if (err) {
NL_SET_BAD_ATTR(info->extack,
info->attrs[NETDEV_A_DEV_IFINDEX]);
goto err_unlock;