From e7d96e750f2bc9b951290c90df421ac5e9adc3ed Mon Sep 17 00:00:00 2001 From: linke li Date: Tue, 23 Apr 2024 18:53:26 +0800 Subject: [PATCH] net: bridge: remove redundant check of f->dst 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 Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller --- net/bridge/br_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index c366ccc8b3db7..ab4d33e020142 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -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); -- 2.30.2