summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 10:48:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 10:48:49 +0100
commitf6b2ce79b5fbbb330f56262f0f4373d6af60b602 (patch)
tree1228dd9989b03011b9c5b5bd193283dfa8321ec4 /drivers/tty/vt
parentfbe7e38f3e57e38916ae7f248fd6efafeb9ecdd3 (diff)
parent4ec5183ec48656cec489c49f989c508b68b518e3 (diff)
downloadlinux-f6b2ce79b5fbbb330f56262f0f4373d6af60b602.tar.gz
Merge 6.2-rc7 into tty-next
We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vc_screen.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 1850bacdb5b0..f566eb1839dc 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -386,10 +386,6 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
uni_mode = use_unicode(inode);
attr = use_attributes(inode);
- ret = -ENXIO;
- vc = vcs_vc(inode, &viewed);
- if (!vc)
- goto unlock_out;
ret = -EINVAL;
if (pos < 0)
@@ -407,6 +403,11 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
unsigned int this_round, skip = 0;
int size;
+ ret = -ENXIO;
+ vc = vcs_vc(inode, &viewed);
+ if (!vc)
+ goto unlock_out;
+
/* Check whether we are above size each round,
* as copy_to_user at the end of this loop
* could sleep.