Skip to content

Commit a6187ff

Browse files
Loic Poulainholtmann
authored andcommitted
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: Dan Carpenter <[email protected]> Signed-off-by: Loic Poulain <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 823b842 commit a6187ff

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/bluetooth/btwilink.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
262262
pkt_type = hci_skb_pkt_type(skb);
263263
len = hst->st_write(skb);
264264
if (len < 0) {
265-
kfree_skb(skb);
266265
BT_ERR("ST write failed (%ld)", len);
267266
/* Try Again, would only fail if UART has gone bad */
268267
return -EAGAIN;

0 commit comments

Comments
 (0)