提交 3fde85df 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

vt_ioctl: return -EFAULT on copy_from_user errors

copy_from_user() returns the number of bytes remaining but we want to
return a negative error code here.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c1bfffa9
......@@ -1303,7 +1303,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
if (!perm)
goto eperm;
ret = copy_from_user(&ui, up, sizeof(struct unimapinit));
if (!ret)
if (ret)
ret = -EFAULT;
else
con_clear_unimap(vc, &ui);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册