On 03/20/2019 06:51 PM, Vakul Garg wrote:
> 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.g...@nxp.com>
> ---

...

>               skb = next_skb;
> @@ -2090,7 +2090,7 @@ 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) {
> -             kfree_skb(ctx->recv_pkt);
> +             consume_skb(ctx->recv_pkt);
>               ctx->recv_pkt = NULL;
>               skb_queue_purge(&ctx->rx_list);
>               crypto_free_aead(ctx->aead_recv);
> 

But skb_queue_purge() will call kfree_skb() anyway.

It looks like the skb is really dropped in this context, it was not consumed.

Reply via email to