Skip to content

Commit

Permalink
Bluetooth: Remove double free of SKB pointer in L2CAP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrei Emeltchenko authored and Marcel Holtmann committed Jan 30, 2010
1 parent b473946 commit fcafde2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3518,7 +3518,6 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
struct l2cap_pinfo *pi;
u16 control, len;
u8 tx_seq;
int err;

sk = l2cap_get_chan_by_scid(&conn->chan_list, cid);
if (!sk) {
Expand Down Expand Up @@ -3570,13 +3569,11 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
goto drop;

if (__is_iframe(control))
err = l2cap_data_channel_iframe(sk, control, skb);
l2cap_data_channel_iframe(sk, control, skb);
else
err = l2cap_data_channel_sframe(sk, control, skb);
l2cap_data_channel_sframe(sk, control, skb);

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

case L2CAP_MODE_STREAMING:
control = get_unaligned_le16(skb->data);
Expand All @@ -3602,7 +3599,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
else
pi->expected_tx_seq = tx_seq + 1;

err = l2cap_sar_reassembly_sdu(sk, skb, control);
l2cap_sar_reassembly_sdu(sk, skb, control);

goto done;

Expand Down

0 comments on commit fcafde2

Please sign in to comment.