We added some new locking here, but missed an error path where we need
to unlock.

Fixes: 9acdf4df2fc4 ('usb: gadget: f_midi: added spinlock on transmit function')
Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/usb/gadget/function/f_midi.c 
b/drivers/usb/gadget/function/f_midi.c
index 56e2dde..2c0616c 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -609,8 +609,10 @@ static void f_midi_transmit(struct f_midi *midi)
 
        do {
                ret = f_midi_do_transmit(midi, ep);
-               if (ret < 0)
+               if (ret < 0) {
+                       spin_unlock_irqrestore(&midi->transmit_lock, flags);
                        goto drop_out;
+               }
        } while (ret);
 
        spin_unlock_irqrestore(&midi->transmit_lock, flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to