Re: [PATCH] nfc: free skb buffer using skb_free_datagram
From: Eric Dumazet
Date: Mon Oct 19 2015 - 12:44:27 EST
On Mon, 2015-10-19 at 15:59 +0000, Insu Yun wrote:
> Freeing sk_buff genereated by skb_recv_datagram is always by
> skb_free_datagram, not kfree_skb.
>
> Signed-off-by: Insu Yun <wuninsu@xxxxxxxxx>
> ---
> net/nfc/llcp_sock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
> index b7de0da..15e681f 100644
> --- a/net/nfc/llcp_sock.c
> +++ b/net/nfc/llcp_sock.c
> @@ -870,7 +870,7 @@ static int llcp_sock_recvmsg(struct socket *sock, struct msghdr *msg,
> }
> }
>
> - kfree_skb(skb);
> + skb_free_datagram(sk, skb);
> }
>
> /* XXX Queue backlogged skbs */
Nope, you are adding a bug here.
Current code is fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/