diff options
author | Soenke Huster <soenke.huster@eknoes.de> | 2021-10-20 10:14:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-27 11:03:03 +0100 |
commit | 1f2270e161f978912100dd7acdfe1894bebcd4f6 (patch) | |
tree | 672b323040cfc1638eec11eea56e2e92fa4e8325 /drivers/bluetooth | |
parent | f28d819f17d35a4ac603157dcbfaf20c16346bcb (diff) | |
download | linux-stable-1f2270e161f978912100dd7acdfe1894bebcd4f6.tar.gz linux-stable-1f2270e161f978912100dd7acdfe1894bebcd4f6.tar.bz2 linux-stable-1f2270e161f978912100dd7acdfe1894bebcd4f6.zip |
Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
[ Upstream commit 1d0688421449718c6c5f46e458a378c9b530ba18 ]
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: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")
Signed-off-by: Soenke Huster <soenke.huster@eknoes.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/virtio_bt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c index 57908ce4fae8..076e4942a3f0 100644 --- a/drivers/bluetooth/virtio_bt.c +++ b/drivers/bluetooth/virtio_bt.c @@ -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_recv_frame(vbt->hdev, skb); break; + default: + kfree_skb(skb); + break; } } |