lkml.org 
[lkml]   [2007]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/bluetooth: Convert kfree to kfree_skb
Please ignore this patch.  In the case of btsdio.c, the enclosing function
is used as an interrupt handler, so it should not use kfree_skb either.

julia



On Tue, 20 Nov 2007, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
>
> kfree_skb rather than kfree should be used for values of type struct
> sk_buff *.
>
> This was fixed using the following semantic patch
> (http://www.emn.fr/x-info/coccinelle/).
>
> // <smpl>
> @@
> struct sk_buff *skb;
> @@
>
> - kfree(skb)
> + kfree_skb(skb)
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> ---
>
> diff -u -p a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
> --- a/drivers/bluetooth/bpa10x.c 2007-11-01 10:30:39.000000000 +0100
> +++ b/drivers/bluetooth/bpa10x.c 2007-11-20 21:07:42.000000000 +0100
> @@ -446,8 +446,8 @@ static void bpa10x_destruct(struct hci_d
>
> BT_DBG("%s", hdev->name);
>
> - kfree(data->rx_skb[0]);
> - kfree(data->rx_skb[1]);
> + kfree_skb(data->rx_skb[0]);
> + kfree_skb(data->rx_skb[1]);
> kfree(data);
> }
>
> diff -u -p a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
> --- a/drivers/bluetooth/btsdio.c 2007-11-01 10:30:39.000000000 +0100
> +++ b/drivers/bluetooth/btsdio.c 2007-11-20 21:07:44.000000000 +0100
> @@ -152,7 +152,7 @@ static int btsdio_rx_packet(struct btsdi
>
> err = sdio_readsb(data->func, skb->data, REG_RDAT, len - 4);
> if (err < 0) {
> - kfree(skb);
> + kfree_skb(skb);
> return err;
> }
>
> @@ -163,7 +163,7 @@ static int btsdio_rx_packet(struct btsdi
>
> err = hci_recv_frame(skb);
> if (err < 0) {
> - kfree(skb);
> + kfree_skb(skb);
> return err;
> }
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-21 11:19    [W:0.024 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site