From 2556cfc7b33e3990e53671649cab1e6aa63718ba Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Fri, 30 Jan 2026 13:48:23 +0100 Subject: [PATCH] usb: fix hang when disconnecting from USB regression introduced in 33d0a3efa3 Change-Id: I0ded61d70a09b27820e65979381d2c38410d2923 --- firmware/usb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/usb.c b/firmware/usb.c index c088db4ef1..e1d0909613 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -877,6 +877,7 @@ void usb_request_exclusive_storage(void) void usb_release_exclusive_storage(void) { + int bccount; if(!exclusive_storage_requested) { return; } @@ -887,10 +888,12 @@ void usb_release_exclusive_storage(void) } exclusive_storage_enabled = false; -#ifdef DEBUG /* Tell all threads that we are back in business */ - int bccount = queue_broadcast(SYS_USB_DISCONNECTED, 0) - 1; + bccount = queue_broadcast(SYS_USB_DISCONNECTED, 0) - 1; +#ifdef DEBUG DEBUGF("USB extracted. Broadcast to %d threads...\n", bccount); +#else + (void)bccount; #endif return; }