Commit 201876b3 authored by Vakul Garg's avatar Vakul Garg Committed by David S. Miller

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: default avatarVakul Garg <vakul.garg@nxp.com>
Acked-by: default avatarDave Watson <davejwatson@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 990e35ec
...@@ -1047,7 +1047,6 @@ void tls_sw_free_resources_tx(struct sock *sk) ...@@ -1047,7 +1047,6 @@ void tls_sw_free_resources_tx(struct sock *sk)
struct tls_context *tls_ctx = tls_get_ctx(sk); struct tls_context *tls_ctx = tls_get_ctx(sk);
struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); 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); tls_free_both_sg(sk);
...@@ -1060,10 +1059,8 @@ void tls_sw_release_resources_rx(struct sock *sk) ...@@ -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); struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
if (ctx->aead_recv) { if (ctx->aead_recv) {
if (ctx->recv_pkt) {
kfree_skb(ctx->recv_pkt); kfree_skb(ctx->recv_pkt);
ctx->recv_pkt = NULL; ctx->recv_pkt = NULL;
}
crypto_free_aead(ctx->aead_recv); crypto_free_aead(ctx->aead_recv);
strp_stop(&ctx->strp); strp_stop(&ctx->strp);
write_lock_bh(&sk->sk_callback_lock); write_lock_bh(&sk->sk_callback_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment