Staging: comedi: fix signal handling in read and write
After sleeping on a wait queue, signal_pending(current) should be checked (not before sleeping). Acked-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
df30b21cb0
commit
6a9ce6b654
@ -1673,11 +1673,11 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
|
||||
retval = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
schedule();
|
||||
if (signal_pending(current)) {
|
||||
retval = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
schedule();
|
||||
if (!s->busy)
|
||||
break;
|
||||
if (s->busy != file) {
|
||||
@ -1780,11 +1780,11 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
|
||||
retval = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
schedule();
|
||||
if (signal_pending(current)) {
|
||||
retval = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
schedule();
|
||||
if (!s->busy) {
|
||||
retval = 0;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user