Skip to content

Commit 8b48baf

Browse files
Su Huimehmetb0
authored andcommitted
net: tipc: avoid possible garbage value
BugLink: https://bugs.launchpad.net/bugs/2086242 [ Upstream commit 99655a3 ] Clang static checker (scan-build) warning: net/tipc/bcast.c:305:4: The expression is an uninitialized value. The computed value will also be garbage [core.uninitialized.Assign] 305 | (*cong_link_cnt)++; | ^~~~~~~~~~~~~~~~~~ tipc_rcast_xmit() will increase cong_link_cnt's value, but cong_link_cnt is uninitialized. Although it won't really cause a problem, it's better to fix it. Fixes: dca4a17 ("tipc: fix potential hanging after b/rcast changing") Signed-off-by: Su Hui <suhui@nfschina.com> Reviewed-by: Justin Stitt <justinstitt@google.com> Link: https://patch.msgid.link/20240912110119.2025503-1-suhui@nfschina.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent e67a8e3 commit 8b48baf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/bcast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb,
320320
{
321321
struct tipc_msg *hdr, *_hdr;
322322
struct sk_buff_head tmpq;
323+
u16 cong_link_cnt = 0;
323324
struct sk_buff *_skb;
324-
u16 cong_link_cnt;
325325
int rc = 0;
326326

327327
/* Is a cluster supporting with new capabilities ? */

0 commit comments

Comments
 (0)