summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/bpf/devmap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index bfecabfd4974..ecf9f99ecc57 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -226,12 +226,10 @@ void __dev_map_flush(struct bpf_map *map)
if (unlikely(!dev))
continue;
- netdev = dev->dev;
__clear_bit(bit, bitmap);
- if (unlikely(!netdev || !netdev->netdev_ops->ndo_xdp_flush))
- continue;
-
- netdev->netdev_ops->ndo_xdp_flush(netdev);
+ netdev = dev->dev;
+ if (likely(netdev->netdev_ops->ndo_xdp_flush))
+ netdev->netdev_ops->ndo_xdp_flush(netdev);
}
}