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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
	}
}