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:
Oleg Zhurakivskyy 2020-05-13 14:46:03 +03:00 committed by Carles Cufí
commit aac4261e73

View file

@ -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(