2012-02-28 06:52:46

by Dan Carpenter

[permalink] [raw]
Subject: [patch] Bluetooth: use kfree_skb() instead of kfree()

sk_buffs should be freed using kfree_skb().

Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index bdcfbf0..df3be69 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4284,7 +4284,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
if (!chan) {
BT_DBG("unknown cid 0x%4.4x", cid);
/* Drop packet and return */
- kfree(skb);
+ kfree_skb(skb);
return 0;
}



2012-03-01 01:39:49

by Johan Hedberg

[permalink] [raw]
Subject: Re: [patch] Bluetooth: use kfree_skb() instead of kfree()

Hi Dan,

On Tue, Feb 28, 2012, Dan Carpenter wrote:
> sk_buffs should be freed using kfree_skb().
>
> Signed-off-by: Dan Carpenter <[email protected]>
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index bdcfbf0..df3be69 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4284,7 +4284,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
> if (!chan) {
> BT_DBG("unknown cid 0x%4.4x", cid);
> /* Drop packet and return */
> - kfree(skb);
> + kfree_skb(skb);
> return 0;
> }

Applied to my bluetooth-next tree. Thanks.

Johan

2012-02-28 16:19:28

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch] Bluetooth: use kfree_skb() instead of kfree()

Hi Dan,

> sk_buffs should be freed using kfree_skb().
>
> Signed-off-by: Dan Carpenter <[email protected]>

sadly these keep slipping in every now and then.

Acked-by: Marcel Holtmann <[email protected]>

Regards

Marcel



2012-02-28 07:57:22

by Andrei Emeltchenko

[permalink] [raw]
Subject: Re: [patch] Bluetooth: use kfree_skb() instead of kfree()

On Tue, Feb 28, 2012 at 09:52:46AM +0300, Dan Carpenter wrote:
> sk_buffs should be freed using kfree_skb().
>
> Signed-off-by: Dan Carpenter <[email protected]>

Sorry missed that.

Acked-by: Andrei Emeltchenko <[email protected]>

>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index bdcfbf0..df3be69 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4284,7 +4284,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
> if (!chan) {
> BT_DBG("unknown cid 0x%4.4x", cid);
> /* Drop packet and return */
> - kfree(skb);
> + kfree_skb(skb);
> return 0;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.