Skip to contentSkip to conversation

Bluetooth: use kfree_skb() instead of kfree()

PATCH Applied Dan Carpenter 4 participants 4 messages Feb 28, 2012 – Mar 1, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: use kfree_skb() instead of kfree()

sk_buffs should be freed using kfree_skb().

net/bluetooth/l2cap_core.c +1 -1
index bdcfbf0..df3be69 100644
@@ -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;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dan Carpenter

sk_buffs should be freed using kfree_skb().

Sorry missed that.

Quoted 15 lines
net/bluetooth/l2cap_core.c +1 -2
index bdcfbf0..df3be69 100644
@@ -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;
 	}
 
--
Quoted 3 lines

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.

#3 lore raw
In reply to Dan Carpenter

Hi Dan,

Quoted 9 lines · Dan Carpenter

sk_buffs should be freed using kfree_skb().

net/bluetooth/l2cap_core.c +0 -0
index bdcfbf0..df3be69 100644

net/bluetooth/l2cap_core.c static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk · line 4289

Quoted 7 lines
net/bluetooth/l2cap_core.c +1 -1
@@ -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