Commit 160fbcf3 authored by Soenke Huster's avatar Soenke Huster Committed by Luiz Augusto von Dentz

Bluetooth: virtio_bt: Use skb_put to set length

By using skb_put we ensure that skb->tail is set
correctly. Currently, skb->tail is always zero, which
leads to errors, such as the following page fault in
rfcomm_recv_frame:

    BUG: unable to handle page fault for address: ffffed1021de29ff
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    RIP: 0010:rfcomm_run+0x831/0x4040 (net/bluetooth/rfcomm/core.c:1751)

Fixes: afd2daa2 ("Bluetooth: Add support for virtio transport driver")
Signed-off-by: default avatarSoenke Huster <soenke.huster@eknoes.de>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent b36a234d
...@@ -219,7 +219,7 @@ static void virtbt_rx_work(struct work_struct *work) ...@@ -219,7 +219,7 @@ static void virtbt_rx_work(struct work_struct *work)
if (!skb) if (!skb)
return; return;
skb->len = len; skb_put(skb, len);
virtbt_rx_handle(vbt, skb); virtbt_rx_handle(vbt, skb);
if (virtbt_add_inbuf(vbt) < 0) if (virtbt_add_inbuf(vbt) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment