提交 a6187ffd 编写于 作者: L Loic Poulain 提交者: Marcel Holtmann

Bluetooth: btwilink: Fix unexpected skb free

The caller (hci_core) still owns the skb in case of error, releasing
it inside the send function can lead to use-after-free errors.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NLoic Poulain <loic.poulain@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 823b8420
...@@ -262,7 +262,6 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -262,7 +262,6 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
pkt_type = hci_skb_pkt_type(skb); pkt_type = hci_skb_pkt_type(skb);
len = hst->st_write(skb); len = hst->st_write(skb);
if (len < 0) { if (len < 0) {
kfree_skb(skb);
BT_ERR("ST write failed (%ld)", len); BT_ERR("ST write failed (%ld)", len);
/* Try Again, would only fail if UART has gone bad */ /* Try Again, would only fail if UART has gone bad */
return -EAGAIN; return -EAGAIN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册