mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
usb: gadget: s3c-hsotg: fix spinlock locking
This patch adds missing spinlock locking in s3c_hsotg_complete_setup function, and unlocking for gadget setup call. Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
af9f51c551
commit
93f599f279
1 changed files with 4 additions and 0 deletions
|
|
@ -1245,7 +1245,9 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg,
|
|||
/* as a fallback, try delivering it to the driver to deal with */
|
||||
|
||||
if (ret == 0 && hsotg->driver) {
|
||||
spin_unlock(&hsotg->lock);
|
||||
ret = hsotg->driver->setup(&hsotg->gadget, ctrl);
|
||||
spin_lock(&hsotg->lock);
|
||||
if (ret < 0)
|
||||
dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret);
|
||||
}
|
||||
|
|
@ -1308,10 +1310,12 @@ static void s3c_hsotg_complete_setup(struct usb_ep *ep,
|
|||
return;
|
||||
}
|
||||
|
||||
spin_lock(&hsotg->lock);
|
||||
if (req->actual == 0)
|
||||
s3c_hsotg_enqueue_setup(hsotg);
|
||||
else
|
||||
s3c_hsotg_process_control(hsotg, req->buf);
|
||||
spin_unlock(&hsotg->lock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue