From ea294fff0cf73a73dec2ac395f6206b3a37a0f18 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 26 Jun 2023 11:55:23 +0200 Subject: [PATCH] lx_emul: fix unplug of unclaimed USB devices USB devices that are never associated to client sessions lack usb_per_dev_data (and a kernel thread). Therefore, the devices should be discontinued directly on unplug as no URBs can be pending. Issue genodelabs/genode#4795 --- repos/dde_linux/src/lib/lx_emul/usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repos/dde_linux/src/lib/lx_emul/usb.c b/repos/dde_linux/src/lib/lx_emul/usb.c index ce253594e4..9baf549220 100644 --- a/repos/dde_linux/src/lib/lx_emul/usb.c +++ b/repos/dde_linux/src/lib/lx_emul/usb.c @@ -800,6 +800,9 @@ static int raw_notify(struct notifier_block *nb, unsigned long action, void *dat if (data) { data->dev = NULL; lx_emul_task_unblock(data->task); + } else { + /* discontinue unclaimed device */ + genode_usb_discontinue_device(udev->bus->busnum, udev->devnum); } break; }