]> git.baikalelectronics.ru Git - kernel.git/commit
vt: vt_ioctl: remove unnecessary console allocation checks
authorEric Biggers <ebiggers@google.com>
Mon, 24 Feb 2020 08:03:26 +0000 (00:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 20:43:49 +0000 (21:43 +0100)
commit98cebc6f3b6180d6b56118d260563331189788a0
tree0ae1611858c2724c808c20cd2d0e1c12c3920c66
parentc124610152cffb32384a73d06683ab5d3b304e56
vt: vt_ioctl: remove unnecessary console allocation checks

The vc_cons_allocated() checks in vt_ioctl() and vt_compat_ioctl() are
unnecessary because they can only be reached by calling ioctl() on an
open tty, which implies the corresponding virtual console is allocated.

And even if the virtual console *could* be freed concurrently, then
these checks would be broken since they aren't done under console_lock,
and the vc_data is dereferenced before them anyway.

So, remove these unneeded checks to avoid confusion.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20200224080326.295046-1-ebiggers@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt_ioctl.c