diff options
author | Andrei Emeltchenko <andrei.emeltchenko@nokia.com> | 2009-12-22 08:58:08 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-01-30 08:57:11 -0500 |
commit | fcafde2e6d81aa7901f9b10e6a097592f0637b79 (patch) | |
tree | e1f80255f43851dcd2cacd836740330dc4cfd2ff | |
parent | b473946a0853860e13b51c28add5524741117786 (diff) |
Bluetooth: Remove double free of SKB pointer in L2CAP
Trivial fix for double free of SKB pointer with kfree_skb to
make code simplier and cleaner. Remove unused variable err.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/l2cap.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 1120cf14a548..8acc19ed9c4d 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -3518,7 +3518,6 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk | |||
3518 | struct l2cap_pinfo *pi; | 3518 | struct l2cap_pinfo *pi; |
3519 | u16 control, len; | 3519 | u16 control, len; |
3520 | u8 tx_seq; | 3520 | u8 tx_seq; |
3521 | int err; | ||
3522 | 3521 | ||
3523 | sk = l2cap_get_chan_by_scid(&conn->chan_list, cid); | 3522 | sk = l2cap_get_chan_by_scid(&conn->chan_list, cid); |
3524 | if (!sk) { | 3523 | if (!sk) { |
@@ -3570,13 +3569,11 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk | |||
3570 | goto drop; | 3569 | goto drop; |
3571 | 3570 | ||
3572 | if (__is_iframe(control)) | 3571 | if (__is_iframe(control)) |
3573 | err = l2cap_data_channel_iframe(sk, control, skb); | 3572 | l2cap_data_channel_iframe(sk, control, skb); |
3574 | else | 3573 | else |
3575 | err = l2cap_data_channel_sframe(sk, control, skb); | 3574 | l2cap_data_channel_sframe(sk, control, skb); |
3576 | 3575 | ||
3577 | if (!err) | 3576 | goto done; |
3578 | goto done; | ||
3579 | break; | ||
3580 | 3577 | ||
3581 | case L2CAP_MODE_STREAMING: | 3578 | case L2CAP_MODE_STREAMING: |
3582 | control = get_unaligned_le16(skb->data); | 3579 | control = get_unaligned_le16(skb->data); |
@@ -3602,7 +3599,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk | |||
3602 | else | 3599 | else |
3603 | pi->expected_tx_seq = tx_seq + 1; | 3600 | pi->expected_tx_seq = tx_seq + 1; |
3604 | 3601 | ||
3605 | err = l2cap_sar_reassembly_sdu(sk, skb, control); | 3602 | l2cap_sar_reassembly_sdu(sk, skb, control); |
3606 | 3603 | ||
3607 | goto done; | 3604 | goto done; |
3608 | 3605 | ||