From: Jakub Kicinski Date: Mon, 7 Oct 2019 04:09:29 +0000 (-0700) Subject: net/tls: make allocation failure unlikely X-Git-Tag: v5.15~5092^2~397^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34ef1ed198cd647bb1cffff79f63814dfaae7c93;p=platform%2Fkernel%2Flinux-starfive.git net/tls: make allocation failure unlikely Make sure GCC realizes it's unlikely that allocations will fail. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller --- diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index fcf38ed..23c19b8 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -452,9 +452,8 @@ static int tls_push_data(struct sock *sk, max_open_record_len = TLS_MAX_PAYLOAD_SIZE + prot->prepend_size; do { - rc = tls_do_allocation(sk, ctx, pfrag, - prot->prepend_size); - if (rc) { + rc = tls_do_allocation(sk, ctx, pfrag, prot->prepend_size); + if (unlikely(rc)) { rc = sk_stream_wait_memory(sk, &timeo); if (!rc) continue;