From: Xiubo Li <xiubli@redhat.com>
To: Hailong Liu <liu.hailong6@zte.com.cn>, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, jiang.biao2@zte.com.cn,
zhong.weidong@zte.com.cn
Subject: Re: [PATCH] uio: fix wrong return value from uio_mmap()
Date: Fri, 20 Jul 2018 08:40:48 +0800 [thread overview]
Message-ID: <8ff360ff-1b0b-9c29-177d-4a025da58d04@redhat.com> (raw)
In-Reply-To: <1532046716-49792-1-git-send-email-liu.hailong6@zte.com.cn>
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@redhat.com>
> Signed-off-by: Hailong Liu <liu.hailong6@zte.com.cn>
> Signed-off-by: Jiang Biao <jiang.biao2@zte.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 = {
prev parent reply other threads:[~2018-07-20 0:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 0:31 Hailong Liu
2018-07-20 0:40 ` Xiubo Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ff360ff-1b0b-9c29-177d-4a025da58d04@redhat.com \
--to=xiubli@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiang.biao2@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=liu.hailong6@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®