Skip to content

Commit

Permalink
Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle()
Browse files Browse the repository at this point in the history
[ Upstream commit 1d06884 ]

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: afd2daa ("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>
  • Loading branch information
eknoes authored and gregkh committed Jan 27, 2022
1 parent f28d819 commit 1f2270e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/bluetooth/virtio_bt.c
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 1f2270e

Please sign in to comment.