summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorDavid S. Miller2018-09-13 07:22:42 +0200
committerDavid S. Miller2018-09-13 07:22:42 +0200
commitaaf9253025e80cf8f62d7b33670e84e838eec5a3 (patch)
treef13b307c8407cc05ff803c4d7f6a0967d85ce3ec /net/tls
parentdocs: net: Remove TCP congestion document (diff)
parentMerge tag 'drm-fixes-2018-09-12' of git://anongit.freedesktop.org/drm/drm (diff)
downloadkernel-qcow2-linux-aaf9253025e80cf8f62d7b33670e84e838eec5a3.tar.gz
kernel-qcow2-linux-aaf9253025e80cf8f62d7b33670e84e838eec5a3.tar.xz
kernel-qcow2-linux-aaf9253025e80cf8f62d7b33670e84e838eec5a3.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index adab598bd6db..8aa4c1dafd6a 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -263,6 +263,9 @@ static int alloc_encrypted_sg(struct sock *sk, int len)
&ctx->sg_encrypted_num_elem,
&ctx->sg_encrypted_size, 0);
+ if (rc == -ENOSPC)
+ ctx->sg_encrypted_num_elem = ARRAY_SIZE(ctx->sg_encrypted_data);
+
return rc;
}
@@ -276,6 +279,9 @@ static int alloc_plaintext_sg(struct sock *sk, int len)
&ctx->sg_plaintext_num_elem, &ctx->sg_plaintext_size,
tls_ctx->pending_open_record_frags);
+ if (rc == -ENOSPC)
+ ctx->sg_plaintext_num_elem = ARRAY_SIZE(ctx->sg_plaintext_data);
+
return rc;
}