[PATCH -next] usb: gadget: midi2: fix missing unlock in f_midi2_block_opts_create()

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

 



In the error path in f_midi2_block_opts_create(), mutex_unlock() is missed,
fix it by move the unlock after 'out' label.

Fixes: 29ee7a4dddd5 ("usb: gadget: midi2: Add configfs support")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
 drivers/usb/gadget/function/f_midi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c
index f1c47753e0c1..5a971ba600fe 100644
--- a/drivers/usb/gadget/function/f_midi2.c
+++ b/drivers/usb/gadget/function/f_midi2.c
@@ -2350,8 +2350,8 @@ static int f_midi2_block_opts_create(struct f_midi2_ep_opts *ep_opts,
 	ep_opts->blks[blk] = block_opts;
 	*block_p = block_opts;
 
-	mutex_unlock(&ep_opts->opts->lock);
  out:
+	mutex_unlock(&ep_opts->opts->lock);
 	return ret;
 }
 
-- 
2.25.1




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

  Powered by Linux