mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Revert "tcp_bpf: properly release resources on error paths"
This reverts commit2efcdbef13which is commit68b54aeff8upstream. 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:
@@ -302,10 +302,8 @@ msg_bytes_ready:
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = tcp_msg_wait_data(sk, psock, timeo);
|
data = tcp_msg_wait_data(sk, psock, timeo);
|
||||||
if (data < 0) {
|
if (data < 0)
|
||||||
copied = data;
|
return data;
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
if (data && !sk_psock_queue_empty(psock))
|
if (data && !sk_psock_queue_empty(psock))
|
||||||
goto msg_bytes_ready;
|
goto msg_bytes_ready;
|
||||||
copied = -EAGAIN;
|
copied = -EAGAIN;
|
||||||
@@ -316,8 +314,6 @@ out:
|
|||||||
tcp_rcv_space_adjust(sk);
|
tcp_rcv_space_adjust(sk);
|
||||||
if (copied > 0)
|
if (copied > 0)
|
||||||
__tcp_cleanup_rbuf(sk, copied);
|
__tcp_cleanup_rbuf(sk, copied);
|
||||||
|
|
||||||
unlock:
|
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
sk_psock_put(sk, psock);
|
sk_psock_put(sk, psock);
|
||||||
return copied;
|
return copied;
|
||||||
@@ -352,10 +348,8 @@ msg_bytes_ready:
|
|||||||
|
|
||||||
timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
|
timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
|
||||||
data = tcp_msg_wait_data(sk, psock, timeo);
|
data = tcp_msg_wait_data(sk, psock, timeo);
|
||||||
if (data < 0) {
|
if (data < 0)
|
||||||
ret = data;
|
return data;
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
if (data) {
|
if (data) {
|
||||||
if (!sk_psock_queue_empty(psock))
|
if (!sk_psock_queue_empty(psock))
|
||||||
goto msg_bytes_ready;
|
goto msg_bytes_ready;
|
||||||
@@ -366,8 +360,6 @@ msg_bytes_ready:
|
|||||||
copied = -EAGAIN;
|
copied = -EAGAIN;
|
||||||
}
|
}
|
||||||
ret = copied;
|
ret = copied;
|
||||||
|
|
||||||
unlock:
|
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
sk_psock_put(sk, psock);
|
sk_psock_put(sk, psock);
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user