--- y/net/tls/tls_sw.c +++ t/net/tls/tls_sw.c @@ -1874,8 +1874,10 @@ int tls_sw_recvmsg(struct sock *sk, psock = sk_psock_get(sk); timeo = tls_rx_reader_lock(sk, ctx, flags & MSG_DONTWAIT); - if (timeo < 0) - return timeo; + if (timeo < 0) { + err = timeo; + goto end; + } bpf_strp_enabled = sk_psock_strp_enabled(psock); /* If crypto failed the connection is broken */ @@ -2080,8 +2082,10 @@ ssize_t tls_sw_splice_read(struct socket int chunk; timeo = tls_rx_reader_lock(sk, ctx, flags & SPLICE_F_NONBLOCK); - if (timeo < 0) - return timeo; + if (timeo < 0) { + err = timeo; + goto splice_read_end; + } if (!skb_queue_empty(&ctx->rx_list)) { skb = __skb_dequeue(&ctx->rx_list);