Skip to content

Commit e7de259

Browse files
Hailong Liugregkh
authored andcommitted
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: 57c5f4d ("uio: fix crash after the device is unregistered") CC: Xiubo Li <[email protected]> Signed-off-by: Hailong Liu <[email protected]> Cc: stable <[email protected]> Signed-off-by: Jiang Biao <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fbb5858 commit e7de259

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/uio/uio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
813813

814814
out:
815815
mutex_unlock(&idev->info_lock);
816-
return 0;
816+
return ret;
817817
}
818818

819819
static const struct file_operations uio_fops = {

0 commit comments

Comments
 (0)