uio: fix wrong return value from uio_mmap()
authorHailong Liu <liu.hailong6@zte.com.cn>
Wed, 13 Feb 2019 16:29:36 +0000 (16:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Feb 2019 07:09:14 +0000 (08:09 +0100)
commit28c618abeee3380a4ead50fe9863b692dd851e07
treeb14d7c81e497b4b7a08ad83eba2fba9ba9810096
parent13af019c87f2d90e663742cb1a819834048842ae
uio: fix wrong return value from uio_mmap()

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>
Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c