lkml.org 
[lkml]   [2009]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/15] airo: Use ppos instead of file->f_pos
    Date
    When updating the priv->writelen value the ppos given to proc_write()
    should be used instead of file->f_pos. This might lead to a wrong writelen
    value when pwrite() is used.

    Signed-off-by: Jan Blunck <jblunck@suse.de>
    ---
    drivers/net/wireless/airo.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
    index abf896a..ae7dea8 100644
    --- a/drivers/net/wireless/airo.c
    +++ b/drivers/net/wireless/airo.c
    @@ -4659,7 +4659,7 @@ static ssize_t proc_write( struct file *file,
    if (copy_from_user(priv->wbuffer + pos, buffer, len))
    return -EFAULT;
    if ( pos + len > priv->writelen )
    - priv->writelen = len + file->f_pos;
    + priv->writelen = pos + len;
    *offset = pos + len;
    return len;
    }
    --
    1.6.4.2


    \
     
     \ /
      Last update: 2009-11-20 17:47    [W:0.020 / U:33.368 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site