Commit 1d068842 authored by Soenke Huster's avatar Soenke Huster Committed by Marcel Holtmann

Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()

On the reception of packets with an invalid packet type, the memory of
the allocated socket buffers is never freed. Add a default case that frees
these to avoid a memory leak.

Fixes: afd2daa2 ("Bluetooth: Add support for virtio transport driver")
Signed-off-by: default avatarSoenke Huster <soenke.huster@eknoes.de>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent b8f5482c
...@@ -202,6 +202,9 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb) ...@@ -202,6 +202,9 @@ static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
hci_skb_pkt_type(skb) = pkt_type; hci_skb_pkt_type(skb) = pkt_type;
hci_recv_frame(vbt->hdev, skb); hci_recv_frame(vbt->hdev, skb);
break; break;
default:
kfree_skb(skb);
break;
} }
} }
......
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