net: tcp2: Handle the packet clone failure
Handle the packet clone failure in tcp_send_process() and terminate the connection. Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
parent
13bcfc165a
commit
aac4261e73
1 changed files with 6 additions and 0 deletions
|
@ -299,6 +299,12 @@ static void tcp_send_process(struct k_work *work)
|
|||
|
||||
pkt = forget ? tcp_slist(&conn->send_queue, get, struct net_pkt,
|
||||
next) : tcp_pkt_clone(pkt);
|
||||
if (!pkt) {
|
||||
NET_ERR("net_pkt alloc failure");
|
||||
tcp_conn_unref(conn);
|
||||
return;
|
||||
}
|
||||
|
||||
tcp_send(pkt);
|
||||
|
||||
if (forget == false && !k_delayed_work_remaining_get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue