- vt-binding-add-sysfs-control-to-the-vt-layer-fix-module-ref-counting.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     vt: Fix module ref counting

has been removed from the -mm tree.  Its filename is

     vt-binding-add-sysfs-control-to-the-vt-layer-fix-module-ref-counting.patch

This patch was dropped because it was folded into vt-binding-add-sysfs-control-to-the-vt-layer.patch

------------------------------------------------------
Subject: vt: Fix module ref counting
From: "Antonino A. Daplas" <adaplas@xxxxxxxxx>


Unbinding a console driver does not set the module ref count to zero.  This is
due to the following:

1. vgacon may point the default console driver pointer (conswitchp) to
   dummycon, so when a module_put(conswitchp->owner) is done, it decrements
   the ref count of dummycon, not fbcon.

2. Pass a unique minor number (con_driver->node) to class_device_create(),
   otherwise, class_device_destroy() may get confused.

Signed-off-by: Antonino Daplas <adaplas@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/vt.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff -puN drivers/char/vt.c~vt-binding-add-sysfs-control-to-the-vt-layer-fix-module-ref-counting drivers/char/vt.c
--- a/drivers/char/vt.c~vt-binding-add-sysfs-control-to-the-vt-layer-fix-module-ref-counting
+++ a/drivers/char/vt.c
@@ -2872,8 +2872,15 @@ static int unbind_con_driver(const struc
 	}
 
 	if (!con_is_bound(defcsw)) {
+		const struct consw *defconsw = conswitchp;
+
 		defcsw->con_startup();
 		con_back->flag |= CON_DRIVER_FLAG_INIT;
+		/*
+		 * vgacon may change the default driver to point
+		 * to dummycon, we restore it here...
+		 */
+		conswitchp = defconsw;
 	}
 
 	if (!con_is_bound(csw))
@@ -3120,8 +3127,8 @@ int register_con_driver(const struct con
 		goto err;
 
 	con_driver->class_dev = class_device_create(vtconsole_class, NULL,
-						    MKDEV(0, 0), NULL,
-						    "vtcon%i",
+						    MKDEV(0, con_driver->node),
+						    NULL, "vtcon%i",
 						    con_driver->node);
 
 	if (IS_ERR(con_driver->class_dev)) {
@@ -3166,7 +3173,8 @@ int unregister_con_driver(const struct c
 		if (con_driver->con == csw &&
 		    con_driver->flag & CON_DRIVER_FLAG_MODULE) {
 			vtconsole_deinit_class_device(con_driver);
-			class_device_destroy(vtconsole_class, MKDEV(0, 0));
+			class_device_destroy(vtconsole_class,
+					     MKDEV(0, con_driver->node));
 			con_driver->con = NULL;
 			con_driver->desc = NULL;
 			con_driver->class_dev = NULL;
@@ -3230,7 +3238,7 @@ static int __init vtconsole_class_init(v
 		if (con->con && !con->class_dev) {
 			con->class_dev =
 				class_device_create(vtconsole_class, NULL,
-						    MKDEV(0, 0), NULL,
+						    MKDEV(0, con->node), NULL,
 						    "vtcon%i", con->node);
 
 			if (IS_ERR(con->class_dev)) {
_

Patches currently in -mm which might be from adaplas@xxxxxxxxx are

origin.patch
savagefb-allocate-space-for-current-and-saved-register.patch
savagefb-add-state-save-and_restore-hooks.patch
fbdev-more-accurate-sync-range-extrapolation.patch
nvidiafb-revise-pci_device_id-table.patch
atyfb-fix-hardware-cursor-handling.patch
atyfb-remove-unneeded-calls-to-wait_for_idle.patch
atyfb-set-correct-acceleration-flags.patch
epson1355fb-update-platform-code.patch
vesafb-update-platform-code.patch
vfb-update-platform-code.patch
vga16fb-update-platform-code.patch
fbdev-static-pseudocolor-with-depth-less-than-4-does.patch
savagefb-whitespace-cleanup.patch
fbdev-firmware-edid-fixes.patch
nvidiafb-add-support-for-geforce-6100-and-related-chipsets.patch
vesafb-fix-return-code-of-vesafb_setcolreg.patch
vesafb-prefer-vga-registers-over-pmi.patch
atyfb-fix-dead-code.patch
fbdev-coverity-bug-85.patch
fbdev-coverity-bug-90.patch
backlight-fix-kconfig-dependency.patch
fbdev-fix-logo-rotation-if-width-=-height.patch
macmodes-fix-section-warning.patch
atyfb-fix-section-warnings.patch
detaching-fbcon-fix-vgacon-to-allow-retaking-of-the.patch
detaching-fbcon-fix-give_up_console.patch
detaching-fbcon-remove-calls-to-pci_disable_device.patch
detaching-fbcon-add-sysfs-class-device-entry-for-fbcon.patch
detaching-fbcon-clean-up-exit-code.patch
detaching-fbcon-add-capability-to-attach-detach-fbcon.patch
detaching-fbcon-update-documentation.patch
vt-binding-add-binding-unbinding-support-for-the-vt.patch
vt-binding-update-fbcon-to-support-binding.patch
vt-binding-fbcon-update-documentation.patch
vt-binding-add-new-doc-file-describing-the-feature.patch
vt-binding-add-sysfs-control-to-the-vt-layer.patch
vt-binding-add-sysfs-control-to-the-vt-layer-fix-module-ref-counting.patch
vt-binding-make-vt-binding-a-kconfig-option.patch
vt-binding-do-not-create-a-device-file-for-class-device.patch
vt-binding-update-documentation.patch
vt-binding-update-documentation-fix.patch
vt-binding-make-mdacon-support-binding.patch
vt-binding-make-newport_con-support-binding.patch
vt-binding-make-newport_con-support-binding-fix.patch
vt-binding-make-promcon-support-binding.patch
vt-binding-make-sticon-support-binding.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux