提交 9dc9affc 编写于 作者: M Mat Martineau 提交者: Johan Hedberg

Bluetooth: Free allocated ERTM SREJ list if init fails

If the ERTM SREJ list is properly allocated but the retransmit list
allocation fails, the SREJ list must be freed before returning from
l2cap_ertm_init.  l2cap_chan_del will not clean up the SREJ list
if l2cap_ertm_init returns a failure code.
Signed-off-by: NMat Martineau <mathewm@codeaurora.org>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 a8c5fb1a
......@@ -2381,7 +2381,11 @@ static inline int l2cap_ertm_init(struct l2cap_chan *chan)
if (err < 0)
return err;
return l2cap_seq_list_init(&chan->retrans_list, chan->remote_tx_win);
err = l2cap_seq_list_init(&chan->retrans_list, chan->remote_tx_win);
if (err < 0)
l2cap_seq_list_free(&chan->srej_list);
return err;
}
static inline __u8 l2cap_select_mode(__u8 mode, __u16 remote_feat_mask)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部