diff options
| author | Sriharsha Allenki <sallenki@codeaurora.org> | 2019-07-22 17:05:45 +0530 |
|---|---|---|
| committer | Sriharsha Allenki <sallenki@codeaurora.org> | 2019-07-22 17:07:58 +0530 |
| commit | f2b3f8dd17049618d8f0a711e4aedaca6b2fd2a8 (patch) | |
| tree | bdee7face697ac132ea7ef3dbbfcdf57eb83d50c | |
| parent | 4461eef69d3ea6b621af30636cf3ee05e3184d81 (diff) | |
usb: ccid: Fix possible scenario of double unlock
There is a possible case of double unlock of the
spinlock ccid_dev->lock when the ccid daemon is trying
to write while the disable is being processed.
Fix this by going to done once the unlock is done.
Also, remove the unnecessary goto at the end of the
function call.
Change-Id: Idab0801cbf9db91e18d933c8088a4af479b8691f
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
| -rw-r--r-- | drivers/usb/gadget/function/f_ccid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_ccid.c b/drivers/usb/gadget/function/f_ccid.c index 9a53cd328cc5..0b335575f245 100644 --- a/drivers/usb/gadget/function/f_ccid.c +++ b/drivers/usb/gadget/function/f_ccid.c @@ -855,9 +855,9 @@ static ssize_t ccid_bulk_write(struct file *fp, const char __user *buf, &bulk_dev->tx_idle))) ccid_request_free(req, ccid_dev->in); r = -ENODEV; + goto done; } spin_unlock_irqrestore(&ccid_dev->lock, flags); - goto done; } done: pr_debug("ccid_bulk_write returning %d\n", r); |
