mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
bpf: netdev is never null in __dev_map_flush
No need to test for it in fast-path, every dev in bpf_dtab_netdev is guaranteed to be non-NULL, otherwise dev_map_update_elem() will fail in the first place. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: John Fastabend <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
d2aaa3dc41
commit
a5e2da6e97
1 file changed
+3
-5
+3
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user