diff options
author | Federico Vaga <federico.vaga@gmail.com> | 2011-10-29 09:47:39 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-09 08:52:40 -0800 |
commit | 56448baac0c3d52501dc26868e15caba1811866d (patch) | |
tree | a63a62fe49fd961a372f053051743057c2abd20d /drivers/staging | |
parent | 261dbf437bce1d339c358e6566925905e49c13fe (diff) | |
download | kernel_samsung_tuna-56448baac0c3d52501dc26868e15caba1811866d.zip kernel_samsung_tuna-56448baac0c3d52501dc26868e15caba1811866d.tar.gz kernel_samsung_tuna-56448baac0c3d52501dc26868e15caba1811866d.tar.bz2 |
Staging: comedi: fix signal handling in read and write
commit 6a9ce6b654e491981f6ef7e214cbd4f63e033848 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 69bd6f0..63e50f7 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -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; |