Skip to contentSkip to conversation

Bluetooth: Remove double free of skb pointer

PATCH In review Andrei Emeltchenko 1 participant 2 messages Dec 22, 2009

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

PATCH 1/1 Bluetooth: Remove double free of skb pointer

From: Andrei Emeltchenko <[email protected]>

Trivial fix for double free of skb pointer with kfree_skb to make code simplier and cleaner.

skb is already freed within l2cap_data_channel_iframe function.

---
 net/bluetooth/l2cap.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
net/bluetooth/l2cap.c +0 -0
index 1120cf1..9584b97 100644
@@ -3574,9 +3574,7 @@ static inline int l2cap_data_channel(struct

l2cap_conn *conn, u16 cid, struct sk

                else
                        err = l2cap_data_channel_sframe(sk, control, skb);

- if (!err)
- goto done;
- break;
+ goto done;

        case L2CAP_MODE_STREAMING:
                control = get_unaligned_le16(skb->data);

--
1.6.0.4

From fb5bfc6157028c6047a8f9ef60abcef89aa243d4 Mon Sep 17 00:00:00 2001
From: Andrei Emeltchenko <[email protected]>
Date: Tue, 22 Dec 2009 15:05:06 +0200
Subject: [PATCH] Bluetooth: Remove double free of skb pointer

Trivial fix for double free of skb pointer with kfree_skb to make code simplier and cleaner.

skb is already freed within l2cap_data_channel_iframe function.

---
 net/bluetooth/l2cap.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
net/bluetooth/l2cap.c +1 -3
index 1120cf1..9584b97 100644
@@ -3574,9 +3574,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 		else
 			err = l2cap_data_channel_sframe(sk, control, skb);
 
-		if (!err)
-			goto done;
-		break;
+		goto done;
 
 	case L2CAP_MODE_STREAMING:
 		control = get_unaligned_le16(skb->data);
Signature · 1 line
1.6.0.4
#1 lore raw

I will resend it shortly. Sorry.

Quoted 31 lines · Andrei Emeltchenko

From: Andrei Emeltchenko <[email protected]>

Trivial fix for double free of skb pointer with kfree_skb to make code simplier and cleaner.

skb is already freed within l2cap_data_channel_iframe function.

---
 net/bluetooth/l2cap.c |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
net/bluetooth/l2cap.c +0 -0
index 1120cf1..9584b97 100644
@@ -3574,9 +3574,7 @@ static inline int l2cap_data_channel(struct

l2cap_conn *conn, u16 cid, struct sk
               else
                       err = l2cap_data_channel_sframe(sk, control, skb);

-               if (!err)
-                       goto done;
-               break;
+               goto done;

       case L2CAP_MODE_STREAMING:
               control = get_unaligned_le16(skb->data); --
1.6.0.4