summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young2016-10-31 18:52:25 +0100
committerMauro Carvalho Chehab2016-11-21 16:19:08 +0100
commit12accdcb92ca997ffc3bf1e76887fb991d5ac773 (patch)
tree36050be1636e7c19bc38a1b65a9d36d8b6b93a4f /drivers/media/rc
parent[media] redrat3: increase set size for lengths to maximum (diff)
downloadkernel-qcow2-linux-12accdcb92ca997ffc3bf1e76887fb991d5ac773.tar.gz
kernel-qcow2-linux-12accdcb92ca997ffc3bf1e76887fb991d5ac773.tar.xz
kernel-qcow2-linux-12accdcb92ca997ffc3bf1e76887fb991d5ac773.zip
[media] lirc: might sleep error in lirc_dev_fop_read
[ 101.457944] ------------[ cut here ]------------ [ 101.457954] WARNING: CPU: 3 PID: 1819 at kernel/sched/core.c:7708 __might_sleep+0x7e/0x80 [ 101.457960] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffc0364bc2>] lirc_dev_fop_read+0x292/0x4e0 [lirc_dev] Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/lirc_dev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 809a8671e3d6..bb2f47a21d68 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -681,7 +681,6 @@ ssize_t lirc_dev_fop_read(struct file *file,
* between while condition checking and scheduling)
*/
add_wait_queue(&ir->buf->wait_poll, &wait);
- set_current_state(TASK_INTERRUPTIBLE);
/*
* while we didn't provide 'length' bytes, device is opened in blocking
@@ -706,13 +705,13 @@ ssize_t lirc_dev_fop_read(struct file *file,
}
mutex_unlock(&ir->irctl_lock);
- schedule();
set_current_state(TASK_INTERRUPTIBLE);
+ schedule();
+ set_current_state(TASK_RUNNING);
if (mutex_lock_interruptible(&ir->irctl_lock)) {
ret = -ERESTARTSYS;
remove_wait_queue(&ir->buf->wait_poll, &wait);
- set_current_state(TASK_RUNNING);
goto out_unlocked;
}
@@ -732,7 +731,6 @@ ssize_t lirc_dev_fop_read(struct file *file,
}
remove_wait_queue(&ir->buf->wait_poll, &wait);
- set_current_state(TASK_RUNNING);
out_locked:
mutex_unlock(&ir->irctl_lock);