Skip to content

Commit

Permalink
net: bridge: remove redundant check of f->dst
Browse files Browse the repository at this point in the history
In br_fill_forward_path(), f->dst is checked not to be NULL, then
immediately read using READ_ONCE and checked again. The first check is
useless, so this patch aims to remove the redundant check of f->dst.

Signed-off-by: linke li <lilinke99@qq.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
linke li authored and David S. Miller committed Apr 25, 2024
1 parent e44894e commit e7d96e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int br_fill_forward_path(struct net_device_path_ctx *ctx,
br_vlan_fill_forward_path_pvid(br, ctx, path);

f = br_fdb_find_rcu(br, ctx->daddr, path->bridge.vlan_id);
if (!f || !f->dst)
if (!f)
return -1;

dst = READ_ONCE(f->dst);
Expand Down

0 comments on commit e7d96e7

Please sign in to comment.