dev->flags are not technically ops lock protected. The IFF_UP flag
will not change when dev->lock is held, but other flags may change
so KCSAN would probably not be impressed. Because of this we added
a dedicated dev->up which is safe to read under dev->lock.
qstats want to make sure device is up, use dev->up.
Reviewed-by: Bobby Eshleman <redacted>
Reviewed-by: Joe Damato <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/core/netdev-genl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index e427bab4c4d2..fa9edfdb32c2 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -775,7 +775,7 @@ netdev_nl_stats_by_queue(struct net_device *netdev, struct sk_buff *rsp,
const struct netdev_stat_ops *ops = netdev->stat_ops;
int i, err;
- if (!(netdev->flags & IFF_UP))
+ if (!netdev->up)
return 0;
i = ctx->rxq_idx;
--
2.55.0