Patchwork bpa10x: free sk_buff with kfree_skb

login
register
mail settings
Submitter Ilpo Järvinen
Date Oct. 29, 2008, 8:05 p.m.
Message ID <Pine.LNX.4.64.0810271821340.7072@wrl-59.cs.helsinki.fi>
Download mbox | patch
Permalink /patch/6304/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ilpo Järvinen - Oct. 29, 2008, 8:05 p.m.
On Sun, 26 Oct 2008, David Miller wrote:

> 2) Couple places trying to pass sk_buff to kfree() instead of
>    kfree_skb().  Fixed by Sergio Luis

I tried with coccinelle and found one more of these, though my
other attempts with it haven't been all that successful... 


--
[PATCH] bpa10x: free sk_buff with kfree_skb

Inspired by Sergio Luis' similar patches, I finally found
a case which is trivial enough that spatch won't choke
on it.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 drivers/bluetooth/bpa10x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Marcel Holtmann - Oct. 30, 2008, 4:09 a.m.
Hi Ilpo,

>> 2) Couple places trying to pass sk_buff to kfree() instead of
>>   kfree_skb().  Fixed by Sergio Luis
>
> I tried with coccinelle and found one more of these, though my
> other attempts with it haven't been all that successful...
>
>
> --
> [PATCH] bpa10x: free sk_buff with kfree_skb
>
> Inspired by Sergio Luis' similar patches, I finally found
> a case which is trivial enough that spatch won't choke
> on it.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

good catch.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Dave, feel free to take this directly and apply it to your trees.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 30, 2008, 5:07 a.m.
From: Marcel Holtmann <marcel@holtmann.org>
Date: Thu, 30 Oct 2008 05:09:34 +0100

> Hi Ilpo,
> 
> >> 2) Couple places trying to pass sk_buff to kfree() instead of
> >>   kfree_skb().  Fixed by Sergio Luis
> >
> > I tried with coccinelle and found one more of these, though my
> > other attempts with it haven't been all that successful...
> >
> >
> > --
> > [PATCH] bpa10x: free sk_buff with kfree_skb
> >
> > Inspired by Sergio Luis' similar patches, I finally found
> > a case which is trivial enough that spatch won't choke
> > on it.
> >
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> 
> good catch.
> 
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> 
> Dave, feel free to take this directly and apply it to your trees.

Thanks, I will.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 32f3a8e..b936d8c 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -443,8 +443,8 @@  static void bpa10x_destruct(struct hci_dev *hdev)
 
 	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);
 }