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

net/tls: Replace kfree_skb() with consume_skb()

To free the skb in normal course of processing, consume_skb() should be
used. Only for failure paths, skb_free() is intended to be used.

https://www.kernel.org/doc/htmldocs/networking/API-consume-skb.htmlSigned-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 08e046c8
...@@ -223,7 +223,7 @@ static int tls_do_decryption(struct sock *sk, ...@@ -223,7 +223,7 @@ static int tls_do_decryption(struct sock *sk,
/* Using skb->sk to push sk through to crypto async callback /* Using skb->sk to push sk through to crypto async callback
* handler. This allows propagating errors up to the socket * handler. This allows propagating errors up to the socket
* if needed. It _must_ be cleared in the async handler * if needed. It _must_ be cleared in the async handler
* before kfree_skb is called. We _know_ skb->sk is NULL * before consume_skb is called. We _know_ skb->sk is NULL
* because it is a clone from strparser. * because it is a clone from strparser.
*/ */
skb->sk = sk; skb->sk = sk;
...@@ -1535,7 +1535,7 @@ static bool tls_sw_advance_skb(struct sock *sk, struct sk_buff *skb, ...@@ -1535,7 +1535,7 @@ static bool tls_sw_advance_skb(struct sock *sk, struct sk_buff *skb,
rxm->full_len -= len; rxm->full_len -= len;
return false; return false;
} }
kfree_skb(skb); consume_skb(skb);
} }
/* Finished with message */ /* Finished with message */
...@@ -1644,7 +1644,7 @@ static int process_rx_list(struct tls_sw_context_rx *ctx, ...@@ -1644,7 +1644,7 @@ static int process_rx_list(struct tls_sw_context_rx *ctx,
if (!is_peek) { if (!is_peek) {
skb_unlink(skb, &ctx->rx_list); skb_unlink(skb, &ctx->rx_list);
kfree_skb(skb); consume_skb(skb);
} }
skb = next_skb; skb = next_skb;
......
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