From: Allan Stephens <allan.stephens@windriver.com> Date: Mon, 23 May 2011 17:14:18 +0000 (-0400) Subject: tipc: Convert fatal broadcast sanity check to non-fatal check X-Git-Tag: firefly_0821_release~3680^2~5008^2~349^2~19 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5e726900380cfff50436ca6c5e08b35b3357d82a;p=firefly-linux-kernel-4.4.55.git tipc: Convert fatal broadcast sanity check to non-fatal check Modifies the existing broadcast link sanity check that detects an attempt to send a message off-node when there are no available destinations so that it no longer causes a kernel panic; instead, the check now issues a warning and stack trace and then returns without sending the message anywhere. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index fa68d1e9ff4b..759b318b5ffb 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -552,12 +552,16 @@ static int tipc_bcbearer_send(struct sk_buff *buf, if (likely(!msg_non_seq(buf_msg(buf)))) { struct tipc_msg *msg; - assert(tipc_bcast_nmap.count != 0); bcbuf_set_acks(buf, tipc_bcast_nmap.count); msg = buf_msg(buf); msg_set_non_seq(msg, 1); msg_set_mc_netid(msg, tipc_net_id); bcl->stats.sent_info++; + + if (WARN_ON(!tipc_bcast_nmap.count)) { + dump_stack(); + return 0; + } } /* Send buffer over bearers until all targets reached */