From 19e2b5b8b2f1a3ec4c02a3904f875dbf0c2fabb5 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 20 Apr 2023 16:17:05 +0200 Subject: [PATCH] usb_net_drv: ensure freeing packets in destructor Ref genodelabs/genode#4795 --- repos/dde_linux/src/drivers/usb_net/main.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repos/dde_linux/src/drivers/usb_net/main.cc b/repos/dde_linux/src/drivers/usb_net/main.cc index 2e2e740740..f83f2f1e60 100644 --- a/repos/dde_linux/src/drivers/usb_net/main.cc +++ b/repos/dde_linux/src/drivers/usb_net/main.cc @@ -182,6 +182,11 @@ Driver::Device::~Device() { driver.devices.remove(&le); if (udev) unregister_device(); + + while (usb.source()->ack_avail()) { + Usb::Packet_descriptor p = usb.source()->get_acked_packet(); + usb.source()->release_packet(p); + } }