diff options
Diffstat (limited to 'litmus/ftdev.c')
-rw-r--r-- | litmus/ftdev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/litmus/ftdev.c b/litmus/ftdev.c index 06fcf4cf77dc..99bc39ffbcef 100644 --- a/litmus/ftdev.c +++ b/litmus/ftdev.c | |||
@@ -230,13 +230,20 @@ static ssize_t ftdev_read(struct file *filp, | |||
230 | * here with copied data because that data would get | 230 | * here with copied data because that data would get |
231 | * lost if the task is interrupted (e.g., killed). | 231 | * lost if the task is interrupted (e.g., killed). |
232 | */ | 232 | */ |
233 | mutex_unlock(&ftdm->lock); | ||
233 | set_current_state(TASK_INTERRUPTIBLE); | 234 | set_current_state(TASK_INTERRUPTIBLE); |
235 | |||
234 | schedule_timeout(50); | 236 | schedule_timeout(50); |
237 | |||
235 | if (signal_pending(current)) { | 238 | if (signal_pending(current)) { |
236 | if (err == 0) | 239 | if (err == 0) |
237 | /* nothing read yet, signal problem */ | 240 | /* nothing read yet, signal problem */ |
238 | err = -ERESTARTSYS; | 241 | err = -ERESTARTSYS; |
239 | break; | 242 | goto out; |
243 | } | ||
244 | if (mutex_lock_interruptible(&ftdm->lock)) { | ||
245 | err = -ERESTARTSYS; | ||
246 | goto out; | ||
240 | } | 247 | } |
241 | } else if (copied < 0) { | 248 | } else if (copied < 0) { |
242 | /* page fault */ | 249 | /* page fault */ |