projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fcafde2
)
Bluetooth: Fix memory leak in L2CAP
author
Andrei Emeltchenko
<
[email protected]
>
Wed, 23 Dec 2009 11:07:14 +0000
(13:07 +0200)
committer
Marcel Holtmann
<
[email protected]
>
Sat, 30 Jan 2010 13:57:20 +0000
(
05:57
-0800)
Move skb_clone after error confition check so it is not going
potentially out of the scope.
Signed-off-by: Andrei Emeltchenko <
[email protected]
>
Acked-by: Gustavo F. Padovan <
[email protected]
>
Signed-off-by: Marcel Holtmann <
[email protected]
>
net/bluetooth/l2cap.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/l2cap.c
b/net/bluetooth/l2cap.c
index 8acc19ed9c4dcc3dcb7d0b1282b2b0acb6963aae..400efa26ddbab7474fdfc1d1992eb204b4104f20 100644
(file)
--- a/
net/bluetooth/l2cap.c
+++ b/
net/bluetooth/l2cap.c
@@
-1368,7
+1368,6
@@
static int l2cap_ertm_send(struct sock *sk)
while ((skb = sk->sk_send_head) && (!l2cap_tx_window_full(sk)) &&
!(pi->conn_state & L2CAP_CONN_REMOTE_BUSY)) {
- tx_skb = skb_clone(skb, GFP_ATOMIC);
if (pi->remote_max_tx &&
bt_cb(skb)->retries == pi->remote_max_tx) {
@@
-1376,6
+1375,8
@@
static int l2cap_ertm_send(struct sock *sk)
break;
}
+ tx_skb = skb_clone(skb, GFP_ATOMIC);
+
bt_cb(skb)->retries++;
control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE);