Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vc: create vcs(a) devices for consoles

The buffer for the consoles are unconditionally allocated at con_init()
time, which miss the creation of the vcs(a) devices.

Since 2.6.30 (commit 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81, 'vcs:
hook sysfs devices into object lifetime instead of "binding"' to be
exact) these devices are no longer created at open() and removed on
close(), but controlled by the lifetime of the buffers.

Reported-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Cc: stable@kernel.org
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kay Sievers and committed by
Linus Torvalds
c46a7aec a7571a5c

+4
+4
drivers/char/vc_screen.c
··· 495 495 496 496 int __init vcs_init(void) 497 497 { 498 + unsigned int i; 499 + 498 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) 499 501 panic("unable to get major %d for vcs device", VCS_MAJOR); 500 502 vc_class = class_create(THIS_MODULE, "vc"); 501 503 502 504 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 503 505 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 506 + for (i = 0; i < MIN_NR_CONSOLES; i++) 507 + vcs_make_sysfs(i); 504 508 return 0; 505 509 }