summaryrefslogtreecommitdiffstats
path: root/drivers/uio
diff options
context:
space:
mode:
authorHailong Liu <liu.hailong6@zte.com.cn>2018-07-20 08:31:56 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-21 08:45:24 +0200
commite7de2590f18a272e63732b9d519250d1b522b2c4 (patch)
treee0150900b0cebaae53db1a1dbd19ccafce7ded39 /drivers/uio
parentfbb5858c1467ef8feccc910ac9e9f529186a9f9d (diff)
downloadlinux-stable-e7de2590f18a272e63732b9d519250d1b522b2c4.tar.gz
linux-stable-e7de2590f18a272e63732b9d519250d1b522b2c4.tar.bz2
linux-stable-e7de2590f18a272e63732b9d519250d1b522b2c4.zip
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: 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>
Diffstat (limited to 'drivers/uio')
-rw-r--r--drivers/uio/uio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index f63967c8e95a..144cf7365288 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -813,7 +813,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
out:
mutex_unlock(&idev->info_lock);
- return 0;
+ return ret;
}
static const struct file_operations uio_fops = {