diff options
author | Jiri Slaby <jslaby@suse.cz> | 2016-03-31 04:08:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 12:26:55 -0400 |
commit | 182846a00f489849c55d113954f0c4a8a286ca39 (patch) | |
tree | 176092eb6f596246b49083174ebe46a61741a275 /drivers/tty/vt | |
parent | b8995f527aac143e83d3900ff39357651ea4e0f6 (diff) |
tty: vt, remove reduntant check
MAX_NR_CONSOLES and MAX_NR_USER_CONSOLES are both 63 since they were
introduced in 1.1.54. And since vc_allocate does:
if (currcons >= MAX_NR_CONSOLES)
return -ENXIO;
if (!vc_cons[currcons].d) {
if (currcons >= MAX_NR_USER_CONSOLES && !capable(CAP_SYS_RESOURCE))
return -EPERM;
}
the second check is pointless. Remove both the check and the macro
MAX_NR_USER_CONSOLES.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r-- | drivers/tty/vt/vt.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 3e3c7575e92d..90305d569c06 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -768,10 +768,6 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ | |||
768 | struct vc_data *vc; | 768 | struct vc_data *vc; |
769 | struct vt_notifier_param param; | 769 | struct vt_notifier_param param; |
770 | 770 | ||
771 | /* prevent users from taking too much memory */ | ||
772 | if (currcons >= MAX_NR_USER_CONSOLES && !capable(CAP_SYS_RESOURCE)) | ||
773 | return -EPERM; | ||
774 | |||
775 | /* due to the granularity of kmalloc, we waste some memory here */ | 771 | /* due to the granularity of kmalloc, we waste some memory here */ |
776 | /* the alloc is done in two steps, to optimize the common situation | 772 | /* the alloc is done in two steps, to optimize the common situation |
777 | of a 25x80 console (structsize=216, screenbuf_size=4000) */ | 773 | of a 25x80 console (structsize=216, screenbuf_size=4000) */ |