Skip to content

Commit ff2aff3

Browse files
jukkarnashif
authored andcommitted
net: tcp2: Make sure the pkt if not null
If the send_queue pkt is null, then do not try to access it. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 037037c commit ff2aff3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/ip/tcp2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@ static void tcp_send_process(struct k_work *work)
366366
struct net_pkt *pkt = tcp_slist(&conn->send_queue, peek_head,
367367
struct net_pkt, next);
368368

369+
if (!pkt) {
370+
return;
371+
}
372+
369373
NET_DBG("%s %s", log_strdup(tcp_th(pkt)), conn->in_retransmission ?
370374
"in_retransmission" : "");
371375

0 commit comments

Comments
 (0)