From 591aadea54c3faeb1934a8f691824a8cd2d35a71 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 14 Nov 2024 11:47:17 +0100 Subject: [PATCH] lx_emul: take usb device lock before resetting it Fix genodelabs/genode#5381 --- repos/dde_linux/src/lib/lx_emul/usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repos/dde_linux/src/lib/lx_emul/usb.c b/repos/dde_linux/src/lib/lx_emul/usb.c index a91d6e8188..e7ddb74e24 100644 --- a/repos/dde_linux/src/lib/lx_emul/usb.c +++ b/repos/dde_linux/src/lib/lx_emul/usb.c @@ -129,7 +129,12 @@ static void release_device(struct usb_per_dev_data * data) usb_driver_release_interface(&usb_drv, iface); } } + + if (usb_lock_device_for_reset(data->dev, NULL)) + return; + usb_reset_device(data->dev); + usb_unlock_device(data->dev); }