Re: [PATCH] netfilter: bridge: initialize err to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/1/23 05:20, xiaolinkui wrote:
From: Linkui Xiao <xiaolinkui@xxxxxxxxxx>

K2CI reported a problem:

	consume_skb(skb);
	return err;
[nf_br_ip_fragment() error]  uninitialized symbol 'err'.

err is not initialized, because returning 0 is expected, initialize err
to 0.

Reported-by: k2ci <kernel-bot@xxxxxxxxxx>
Signed-off-by: Linkui Xiao <xiaolinkui@xxxxxxxxxx>
---
  net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index 71056ee84773..0fcf357ea7ad 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -37,7 +37,7 @@ static int nf_br_ip_fragment(struct net *net, struct sock *sk,
  	ktime_t tstamp = skb->tstamp;
  	struct ip_frag_state state;
  	struct iphdr *iph;
-	int err;
+	int err = 0;
/* for offloaded checksums cleanup checksum before fragmentation */
  	if (skb->ip_summed == CHECKSUM_PARTIAL &&

The patch looks good, but needs a Fixes: tag. It's also not easy to say
if err can remain uninitialized, I think in theory (and maybe with a
specially crafted skb) it can be.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux