lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 21 Nov 2007 11:15:25 +0100 (MET)
From:	Julia Lawall <julia@...u.dk>
To:	marcel@...tmann.org, maxk@...lcomm.com,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [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@...u.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@...u.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ