Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278578
b: refs/heads/master
c: aef89f2
h: refs/heads/master
v: v3
  • Loading branch information
Szymon Janc authored and Gustavo F. Padovan committed Nov 16, 2011
1 parent 1f57608 commit ab4619f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 36acbb1adadf1ba300f14ee904a7d3f23120e0d6
refs/heads/master: aef89f214e4306153c7913b9854456595153f5d8
20 changes: 17 additions & 3 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3788,7 +3788,7 @@ static void l2cap_resend_srejframe(struct l2cap_chan *chan, u16 tx_seq)
}
}

static void l2cap_send_srejframe(struct l2cap_chan *chan, u16 tx_seq)
static int l2cap_send_srejframe(struct l2cap_chan *chan, u16 tx_seq)
{
struct srej_list *new;
u32 control;
Expand All @@ -3799,6 +3799,9 @@ static void l2cap_send_srejframe(struct l2cap_chan *chan, u16 tx_seq)
l2cap_send_sframe(chan, control);

new = kzalloc(sizeof(struct srej_list), GFP_ATOMIC);
if (!new)
return -ENOMEM;

new->tx_seq = chan->expected_tx_seq;

chan->expected_tx_seq = __next_seq(chan, chan->expected_tx_seq);
Expand All @@ -3807,6 +3810,8 @@ static void l2cap_send_srejframe(struct l2cap_chan *chan, u16 tx_seq)
}

chan->expected_tx_seq = __next_seq(chan, chan->expected_tx_seq);

return 0;
}

static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u32 rx_control, struct sk_buff *skb)
Expand Down Expand Up @@ -3877,7 +3882,12 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u32 rx_cont
return 0;
}
}
l2cap_send_srejframe(chan, tx_seq);

err = l2cap_send_srejframe(chan, tx_seq);
if (err < 0) {
l2cap_send_disconn_req(chan->conn, chan, -err);
return err;
}
}
} else {
expected_tx_seq_offset = __seq_offset(chan,
Expand All @@ -3899,7 +3909,11 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u32 rx_cont

set_bit(CONN_SEND_PBIT, &chan->conn_state);

l2cap_send_srejframe(chan, tx_seq);
err = l2cap_send_srejframe(chan, tx_seq);
if (err < 0) {
l2cap_send_disconn_req(chan->conn, chan, -err);
return err;
}

__clear_ack_timer(chan);
}
Expand Down

0 comments on commit ab4619f

Please sign in to comment.