@@ -939,9 +939,7 @@ void tipc_link_reset(struct tipc_link *l)
939
939
int tipc_link_xmit (struct tipc_link * l , struct sk_buff_head * list ,
940
940
struct sk_buff_head * xmitq )
941
941
{
942
- struct tipc_msg * hdr = buf_msg (skb_peek (list ));
943
942
unsigned int maxwin = l -> window ;
944
- int imp = msg_importance (hdr );
945
943
unsigned int mtu = l -> mtu ;
946
944
u16 ack = l -> rcv_nxt - 1 ;
947
945
u16 seqno = l -> snd_nxt ;
@@ -950,8 +948,14 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,
950
948
struct sk_buff_head * backlogq = & l -> backlogq ;
951
949
struct sk_buff * skb , * _skb , * * tskb ;
952
950
int pkt_cnt = skb_queue_len (list );
951
+ struct tipc_msg * hdr ;
953
952
int rc = 0 ;
953
+ int imp ;
954
+
955
+ if (pkt_cnt <= 0 )
956
+ return 0 ;
954
957
958
+ hdr = buf_msg (skb_peek (list ));
955
959
if (unlikely (msg_size (hdr ) > mtu )) {
956
960
pr_warn ("Too large msg, purging xmit list %d %d %d %d %d!\n" ,
957
961
skb_queue_len (list ), msg_user (hdr ),
@@ -960,6 +964,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,
960
964
return - EMSGSIZE ;
961
965
}
962
966
967
+ imp = msg_importance (hdr );
963
968
/* Allow oversubscription of one data msg per source at congestion */
964
969
if (unlikely (l -> backlog [imp ].len >= l -> backlog [imp ].limit )) {
965
970
if (imp == TIPC_SYSTEM_IMPORTANCE ) {
0 commit comments