Skip to contentSkip to conversation

bluetooth: 6lowpan: fix skb_unshare behaviour

PATCH In review Alexander Aring 3 participants 5 messages Oct 8, 2014 – Nov 8, 2014

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

PATCH 1/1 bluetooth: 6lowpan: fix skb_unshare behaviour

This patch reverts commit:

a7807d73 ("Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails")

which was wrong suggested by Alexander Aring. The function skb_unshare run also kfree_skb on failure.

---
compile tested only.

 net/bluetooth/6lowpan.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
net/bluetooth/6lowpan.c +2 -6
index c2e0d14..cfbb39e 100644
@@ -591,17 +591,13 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
 	int err = 0;
 	bdaddr_t addr;
 	u8 addr_type;
-	struct sk_buff *tmpskb;
 
 	/* We must take a copy of the skb before we modify/replace the ipv6
 	 * header as the header could be used elsewhere
 	 */
-	tmpskb = skb_unshare(skb, GFP_ATOMIC);
-	if (!tmpskb) {
-		kfree_skb(skb);
+	skb = skb_unshare(skb, GFP_ATOMIC);
+	if (!skb)
 		return NET_XMIT_DROP;
-	}
-	skb = tmpskb;
 
 	/* Return values from setup_header()
 	 *  <0 - error, packet is dropped
Signature · 1 line
2.1.2
#1 lore raw

Hi Alex,

Quoted 8 lines · Alexander Aring

This patch reverts commit:

a7807d73 ("Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails")

which was wrong suggested by Alexander Aring. The function skb_unshare run also kfree_skb on failure.

Quoted 6 lines

---
compile tested only.

 net/bluetooth/6lowpan.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

This doesn't look like something that should only go to bluetooth-next (which you've tagged it for). The bluetooth-next tree (since 3.17 has been released) has moved to catering 3.19 patches whereas this patch seems to be something that's fixing an issue heading to 3.18-rc1. So it seems to me this patch should in fact be going to the bluetooth.git tree instead of bluetooth-next.git. Am I right?

Johan

#2 lore raw

Hi Johan,

Quoted 18 lines · Johan Hedberg

Hi Alex,

Quoted 8 lines · Alexander Aring

This patch reverts commit:

a7807d73 ("Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails")

which was wrong suggested by Alexander Aring. The function skb_unshare run also kfree_skb on failure.

Quoted 6 lines

---
compile tested only.

 net/bluetooth/6lowpan.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 7 lines

This doesn't look like something that should only go to bluetooth-next (which you've tagged it for). The bluetooth-next tree (since 3.17 has been released) has moved to catering 3.19 patches whereas this patch seems to be something that's fixing an issue heading to 3.18-rc1. So it seems to me this patch should in fact be going to the bluetooth.git tree instead of bluetooth-next.git. Am I right?

yes, but commit a7807d73 isn't inside of bluetooth.git right now. Should I rebase it to some other repository or cc stable here?

- Alex

#3 lore raw

Hi Alex,

Quoted 27 lines · Alexander Aring
Quoted 18 lines · Johan Hedberg

Hi Alex,

Quoted 8 lines · Alexander Aring

This patch reverts commit:

a7807d73 ("Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails")

which was wrong suggested by Alexander Aring. The function skb_unshare run also kfree_skb on failure.

Quoted 6 lines

---
compile tested only.

 net/bluetooth/6lowpan.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Quoted 7 lines

This doesn't look like something that should only go to bluetooth-next (which you've tagged it for). The bluetooth-next tree (since 3.17 has been released) has moved to catering 3.19 patches whereas this patch seems to be something that's fixing an issue heading to 3.18-rc1. So it seems to me this patch should in fact be going to the bluetooth.git tree instead of bluetooth-next.git. Am I right?

Quoted 2 lines

yes, but commit a7807d73 isn't inside of bluetooth.git right now. Should I rebase it to some other repository or cc stable here?

No, you shouldn't need to do anything. We'll take care of rebasing bluetooth.git appropriately, applying the patch and eventually making a pull request for it. My only concern was with the "PATCH bluetooth-next" annotation in the subject.

Johan

maintainer
#4 lore raw
In reply to Alexander Aring

Hi Alex,

Quoted 8 lines

This patch reverts commit:

a7807d73 ("Bluetooth: 6lowpan: Avoid memory leak if memory allocation fails")

which was wrong suggested by Alexander Aring. The function skb_unshare run also kfree_skb on failure.

Quoted 6 lines

---
compile tested only.

net/bluetooth/6lowpan.c | 8 ++------

1 file changed, 2 insertions(+), 6 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel