Commit 117dabce authored by Federico Vaga's avatar Federico Vaga Committed by Greg Kroah-Hartman

Staging: comedi: fix signal handling in read and write

commit 6a9ce6b6 upstream.

After sleeping on a wait queue, signal_pending(current) should be
checked (not before sleeping).
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 300b3028
......@@ -1599,11 +1599,11 @@ static ssize_t comedi_write(struct file *file, const char *buf, size_t nbytes,
retval = -EAGAIN;
break;
}
schedule();
if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
schedule();
if (!s->busy)
break;
if (s->busy != file) {
......@@ -1706,11 +1706,11 @@ static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes,
retval = -EAGAIN;
break;
}
schedule();
if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
schedule();
if (!s->busy) {
retval = 0;
break;
......
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