usb: fix hang when disconnecting from USB

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 2556cfc7b33e3990e53671649cab1e6aa63718ba
Author: Christian Soffke <[email protected]>
Date:   Fri Jan 30 13:48:23 2026 +0100

    usb: fix hang when disconnecting from USB
    
    regression introduced in 33d0a3efa3
    
    Change-Id: I0ded61d70a09b27820e65979381d2c38410d2923

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;
 }
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.