Revert "tcp_bpf: properly release resources on error paths"

This reverts commit 2efcdbef13 which is
commit 68b54aeff804acceb02f228ea2e28419272c1fb9 upstream.

It breaks the android ABI and if this is needed in the future, can be
brought back in an abi-safe way.

Bug: 161946584
Change-Id: Id1fb9acd3af73153dce124f7c4726250ecbc74c1
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-11-06 14:48:34 +00:00
parent 904cdc97d4
commit a5f2364ea6

View file

@ -302,10 +302,8 @@ msg_bytes_ready:
}
data = tcp_msg_wait_data(sk, psock, timeo);
if (data < 0) {
copied = data;
goto unlock;
}
if (data < 0)
return data;
if (data && !sk_psock_queue_empty(psock))
goto msg_bytes_ready;
copied = -EAGAIN;
@ -316,8 +314,6 @@ out:
tcp_rcv_space_adjust(sk);
if (copied > 0)
__tcp_cleanup_rbuf(sk, copied);
unlock:
release_sock(sk);
sk_psock_put(sk, psock);
return copied;
@ -352,10 +348,8 @@ msg_bytes_ready:
timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
data = tcp_msg_wait_data(sk, psock, timeo);
if (data < 0) {
ret = data;
goto unlock;
}
if (data < 0)
return data;
if (data) {
if (!sk_psock_queue_empty(psock))
goto msg_bytes_ready;
@ -366,8 +360,6 @@ msg_bytes_ready:
copied = -EAGAIN;
}
ret = copied;
unlock:
release_sock(sk);
sk_psock_put(sk, psock);
return ret;