drivers/tty/vt/vc_screen.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index f566eb1839dc..c599b452969f 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -406,19 +406,17 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ret = -ENXIO; vc = vcs_vc(inode, &viewed); if (!vc) - goto unlock_out; + break; /* Check whether we are above size each round, * as copy_to_user at the end of this loop * could sleep. */ - size = vcs_size(vc, attr, uni_mode); - if (size < 0) { - if (read) - break; - ret = size; - goto unlock_out; - } + ret = vcs_size(vc, attr, uni_mode); + if (ret < 0) + break; + size = ret; + ret = 0; if (pos >= size) break; if (count > size - pos)