lkml.org 
[lkml]   [2018]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 24/35] uio: fix wrong return value from uio_mmap()
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

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

    From: Hailong Liu <liu.hailong6@zte.com.cn>

    commit e7de2590f18a272e63732b9d519250d1b522b2c4 upstream.

    uio_mmap has multiple fail paths to set return value to nonzero then
    goto out. However, it always returns *0* from the *out* at end, and
    this will mislead callers who check the return value of this function.

    Fixes: 57c5f4df0a5a0ee ("uio: fix crash after the device is unregistered")
    CC: Xiubo Li <xiubli@redhat.com>
    Signed-off-by: Hailong Liu <liu.hailong6@zte.com.cn>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/uio/uio.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/uio/uio.c
    +++ b/drivers/uio/uio.c
    @@ -814,7 +814,7 @@ static int uio_mmap(struct file *filep,

    out:
    mutex_unlock(&idev->info_lock);
    - return 0;
    + return ret;
    }

    static const struct file_operations uio_fops = {

    \
     
     \ /
      Last update: 2018-08-21 08:25    [W:3.174 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site