提交 e7de2590 编写于 作者: H Hailong Liu 提交者: Greg Kroah-Hartman

uio: fix wrong return value from uio_mmap()

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: 57c5f4df ("uio: fix crash after the device is unregistered")
CC: Xiubo Li <xiubli@redhat.com>
Signed-off-by: NHailong Liu <liu.hailong6@zte.com.cn>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NJiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 fbb5858c
...@@ -813,7 +813,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma) ...@@ -813,7 +813,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
out: out:
mutex_unlock(&idev->info_lock); mutex_unlock(&idev->info_lock);
return 0; return ret;
} }
static const struct file_operations uio_fops = { static const struct file_operations uio_fops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册