diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-11-21 07:49:17 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-11-25 11:25:57 -0500 |
commit | 93f599f279ab56b1761c76e53f9753b26aeefe9e (patch) | |
tree | d790d1312d54076a798eee95596480bee0f43a08 /drivers/usb | |
parent | af9f51c5512f9d55972603dd5dd90d0fa300b200 (diff) |
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 <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 9875d9c0823f..56fad76baa53 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -1245,7 +1245,9 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg, | |||
1245 | /* as a fallback, try delivering it to the driver to deal with */ | 1245 | /* as a fallback, try delivering it to the driver to deal with */ |
1246 | 1246 | ||
1247 | if (ret == 0 && hsotg->driver) { | 1247 | if (ret == 0 && hsotg->driver) { |
1248 | spin_unlock(&hsotg->lock); | ||
1248 | ret = hsotg->driver->setup(&hsotg->gadget, ctrl); | 1249 | ret = hsotg->driver->setup(&hsotg->gadget, ctrl); |
1250 | spin_lock(&hsotg->lock); | ||
1249 | if (ret < 0) | 1251 | if (ret < 0) |
1250 | dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret); | 1252 | dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret); |
1251 | } | 1253 | } |
@@ -1308,10 +1310,12 @@ static void s3c_hsotg_complete_setup(struct usb_ep *ep, | |||
1308 | return; | 1310 | return; |
1309 | } | 1311 | } |
1310 | 1312 | ||
1313 | spin_lock(&hsotg->lock); | ||
1311 | if (req->actual == 0) | 1314 | if (req->actual == 0) |
1312 | s3c_hsotg_enqueue_setup(hsotg); | 1315 | s3c_hsotg_enqueue_setup(hsotg); |
1313 | else | 1316 | else |
1314 | s3c_hsotg_process_control(hsotg, req->buf); | 1317 | s3c_hsotg_process_control(hsotg, req->buf); |
1318 | spin_unlock(&hsotg->lock); | ||
1315 | } | 1319 | } |
1316 | 1320 | ||
1317 | /** | 1321 | /** |