[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8ff360ff-1b0b-9c29-177d-4a025da58d04@redhat.com>
Date: Fri, 20 Jul 2018 08:40:48 +0800
From: Xiubo Li <xiubli@...hat.com>
To: Hailong Liu <liu.hailong6@....com.cn>, gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, jiang.biao2@....com.cn,
zhong.weidong@....com.cn
Subject: Re: [PATCH] uio: fix wrong return value from uio_mmap()
On 2018/7/20 8:31, Hailong Liu wrote:
> 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@...hat.com>
> Signed-off-by: Hailong Liu <liu.hailong6@....com.cn>
> Signed-off-by: Jiang Biao <jiang.biao2@....com.cn>
> ---
> drivers/uio/uio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index 5d421d7..0ddfda2 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -814,7 +814,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
>
> out:
> mutex_unlock(&idev->info_lock);
> - return 0;
> + return ret;
Hi Hailong,
Good catch, Thanks.
BRs
> }
>
> static const struct file_operations uio_fops = {
Powered by blists - more mailing lists