summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-10-07 06:09:29 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-07 15:58:27 +0200
commit34ef1ed198cd647bb1cffff79f63814dfaae7c93 (patch)
tree1706f2e4b41d000bd3f94e6963df75ac2f9d17a0 /net
parentnet/tls: mark sk->err being set as unlikely (diff)
downloadlinux-34ef1ed198cd647bb1cffff79f63814dfaae7c93.tar.xz
linux-34ef1ed198cd647bb1cffff79f63814dfaae7c93.zip
net/tls: make allocation failure unlikely
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>
Diffstat (limited to 'net')
-rw-r--r--net/tls/tls_device.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index fcf38edc07d6..23c19b8ff04e 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;