Skip to content

Commit

Permalink
net/tls: make allocation failure unlikely
Browse files Browse the repository at this point in the history
Make sure GCC realizes it's unlikely that allocations will fail.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Oct 7, 2019
1 parent 93277b2 commit 34ef1ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/tls/tls_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 34ef1ed

Please sign in to comment.