lkml.org 
[lkml]   [2011]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[14/27] Staging: comedi: fix signal handling in read and write
    2.6.32-longterm review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Federico Vaga <federico.vaga@gmail.com>

    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>

    ---
    drivers/staging/comedi/comedi_fops.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/staging/comedi/comedi_fops.c
    +++ b/drivers/staging/comedi/comedi_fops.c
    @@ -1599,11 +1599,11 @@ static ssize_t comedi_write(struct file
    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 *
    retval = -EAGAIN;
    break;
    }
    + schedule();
    if (signal_pending(current)) {
    retval = -ERESTARTSYS;
    break;
    }
    - schedule();
    if (!s->busy) {
    retval = 0;
    break;



    \
     
     \ /
      Last update: 2011-12-07 18:05    [W:0.021 / U:0.088 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site