Commit 291e276a authored by Domen Puncer's avatar Domen Puncer Committed by Linus Torvalds

[PATCH] char/snsc: reorder set_current_state() and add_wait_queue()

Reorder add_wait_queue() and set_current_state() as a signal could be lost in
between the two functions.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b6fb6f26
......@@ -192,8 +192,8 @@ scdrv_read(struct file *file, char __user *buf, size_t count, loff_t *f_pos)
}
len = CHUNKSIZE;
add_wait_queue(&sd->sd_rq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&sd->sd_rq, &wait);
spin_unlock_irqrestore(&sd->sd_rlock, flags);
schedule_timeout(SCDRV_TIMEOUT);
......@@ -288,8 +288,8 @@ scdrv_write(struct file *file, const char __user *buf,
return -EAGAIN;
}
add_wait_queue(&sd->sd_wq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&sd->sd_wq, &wait);
spin_unlock_irqrestore(&sd->sd_wlock, flags);
schedule_timeout(SCDRV_TIMEOUT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment