[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180716155715.13987-5-vakul.garg@nxp.com>
Date: Mon, 16 Jul 2018 21:27:15 +0530
From: Vakul Garg <vakul.garg@....com>
To: netdev@...r.kernel.org
Cc: borisp@...lanox.com, aviadye@...lanox.com, davejwatson@...com,
davem@...emloft.net, Vakul Garg <vakul.garg@....com>
Subject: [net-next v2 5/5] net/tls: Rework error checking after decrypt_skb_update()
Error checking code after invoking decrypt_skb_update() for zero-copy
and non-zero-copy cases in tls_sw_recvmsg has been made common.
Signed-off-by: Vakul Garg <vakul.garg@....com>
---
net/tls/tls_sw.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 55960088baea..0e915d4a30bc 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -825,18 +825,16 @@ int tls_sw_recvmsg(struct sock *sk,
err = decrypt_skb_update(sk, skb, sgin);
for (; pages > 0; pages--)
put_page(sg_page(&sgin[pages]));
- if (err < 0) {
- tls_err_abort(sk, EBADMSG);
- goto recv_end;
- }
} else {
fallback_to_reg_recv:
err = decrypt_skb_update(sk, skb, NULL);
- if (err < 0) {
- tls_err_abort(sk, EBADMSG);
- goto recv_end;
- }
}
+
+ if (err < 0) {
+ tls_err_abort(sk, EBADMSG);
+ goto recv_end;
+ }
+
ctx->decrypted = true;
}
--
2.13.6
Powered by blists - more mailing lists