usb_hid_drv: ensure freeing packets in destructor

Ref genodelabs/genode#4795
This commit is contained in:
Stefan Kalkowski 2023-04-20 16:17:20 +02:00 committed by Christian Helmuth
parent 19e2b5b8b2
commit f079d1f7c3

View File

@ -155,6 +155,11 @@ Driver::Device::Device(Driver & driver, Label label)
Driver::Device::~Device()
{
driver.devices.remove(&le);
while (usb.source()->ack_avail()) {
Usb::Packet_descriptor p = usb.source()->get_acked_packet();
usb.source()->release_packet(p);
}
}