Skip to content

Commit a88c26f

Browse files
nxa22042davem330
authored andcommitted
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.html Signed-off-by: Vakul Garg <vakul.garg@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 08e046c commit a88c26f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/tls/tls_sw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int tls_do_decryption(struct sock *sk,
223223
/* Using skb->sk to push sk through to crypto async callback
224224
* handler. This allows propagating errors up to the socket
225225
* if needed. It _must_ be cleared in the async handler
226-
* before kfree_skb is called. We _know_ skb->sk is NULL
226+
* before consume_skb is called. We _know_ skb->sk is NULL
227227
* because it is a clone from strparser.
228228
*/
229229
skb->sk = sk;
@@ -1535,7 +1535,7 @@ static bool tls_sw_advance_skb(struct sock *sk, struct sk_buff *skb,
15351535
rxm->full_len -= len;
15361536
return false;
15371537
}
1538-
kfree_skb(skb);
1538+
consume_skb(skb);
15391539
}
15401540

15411541
/* Finished with message */
@@ -1644,7 +1644,7 @@ static int process_rx_list(struct tls_sw_context_rx *ctx,
16441644

16451645
if (!is_peek) {
16461646
skb_unlink(skb, &ctx->rx_list);
1647-
kfree_skb(skb);
1647+
consume_skb(skb);
16481648
}
16491649

16501650
skb = next_skb;

0 commit comments

Comments
 (0)