Thread (3 messages) flat view 3 messages, 3 authors, 2021-10-19
STALE1796d

[PATCH] Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()

From: Soenke Huster <hidden>
Date: 2021-10-15 22:58:23
Also in: lkml
Subsystem: bluetooth drivers, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

On the reception of packets with a packet type that is not processed by
the virtbt driver, the memory of the allocated socket buffers is never
freed. Add a default case that frees these to avoid a memory leak.

Signed-off-by: Soenke Huster <redacted>
---
 drivers/bluetooth/virtio_bt.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
index 57908ce4fae8..2de0f54ada73 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -202,6 +202,8 @@ 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);
 	}
 }
 
-- 
2.33.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help