summaryrefslogtreecommitdiff
path: root/net/tls
diff options
context:
space:
mode:
authorVakul Garg <vakul.garg@nxp.com>2018-07-24 16:54:27 +0530
committerDavid S. Miller <davem@davemloft.net>2018-07-26 14:01:55 -0700
commit201876b33c09edcb6c2914f0ced798437a102648 (patch)
tree9787699d93660c7b25bc3656c6b6c85584bbc47b /net/tls
parent990e35ecba1cb8ebee4ad4a028735e24f4615417 (diff)
downloadlinux-rpi3-201876b33c09edcb6c2914f0ced798437a102648.tar.gz
linux-rpi3-201876b33c09edcb6c2914f0ced798437a102648.tar.bz2
linux-rpi3-201876b33c09edcb6c2914f0ced798437a102648.zip
net/tls: Removed redundant checks for non-NULL
Removed checks against non-NULL before calling kfree_skb() and crypto_free_aead(). These functions are safe to be called with NULL as an argument. Signed-off-by: Vakul Garg <vakul.garg@nxp.com> Acked-by: Dave Watson <davejwatson@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 03f1370f5db1..0687a7a4689f 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1047,8 +1047,7 @@ void tls_sw_free_resources_tx(struct sock *sk)
struct tls_context *tls_ctx = tls_get_ctx(sk);
struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
- if (ctx->aead_send)
- crypto_free_aead(ctx->aead_send);
+ crypto_free_aead(ctx->aead_send);
tls_free_both_sg(sk);
kfree(ctx);
@@ -1060,10 +1059,8 @@ void tls_sw_release_resources_rx(struct sock *sk)
struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
if (ctx->aead_recv) {
- if (ctx->recv_pkt) {
- kfree_skb(ctx->recv_pkt);
- ctx->recv_pkt = NULL;
- }
+ kfree_skb(ctx->recv_pkt);
+ ctx->recv_pkt = NULL;
crypto_free_aead(ctx->aead_recv);
strp_stop(&ctx->strp);
write_lock_bh(&sk->sk_callback_lock);