[patch] usb: gadget: f_midi: unlock on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <dan.carpenter@xxxxxxxxxx>

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux