- vt-honor-the-return-value-of-device_create_file.patch removed from -mm tree

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

 



The patch titled

     vt: Honor the return value of device_create_file

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

     vt-honor-the-return-value-of-device_create_file.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: vt: Honor the return value of device_create_file
From: "Antonino A. Daplas" <adaplas@xxxxxxxxx>

Check the return value of device_create_file().  If return is 'fail', remove
attributes by calling device_remove_file().

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

 drivers/char/vt.c |   31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff -puN drivers/char/vt.c~vt-honor-the-return-value-of-device_create_file drivers/char/vt.c
--- a/drivers/char/vt.c~vt-honor-the-return-value-of-device_create_file
+++ a/drivers/char/vt.c
@@ -106,7 +106,8 @@
 #define MAX_NR_CON_DRIVER 16
 
 #define CON_DRIVER_FLAG_MODULE 1
-#define CON_DRIVER_FLAG_INIT 2
+#define CON_DRIVER_FLAG_INIT   2
+#define CON_DRIVER_FLAG_ATTR   4
 
 struct con_driver {
 	const struct consw *con;
@@ -3070,22 +3071,37 @@ static struct class_device_attribute cla
 static int vtconsole_init_class_device(struct con_driver *con)
 {
 	int i;
+	int error = 0;
 
+	con->flag |= CON_DRIVER_FLAG_ATTR;
 	class_set_devdata(con->class_dev, con);
-	for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
-		class_device_create_file(con->class_dev,
+	for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) {
+		error = class_device_create_file(con->class_dev,
 					 &class_device_attrs[i]);
+		if (error)
+			break;
+	}
 
-	return 0;
+	if (error) {
+		while (--i >= 0)
+			class_device_remove_file(con->class_dev,
+					 &class_device_attrs[i]);
+		con->flag &= ~CON_DRIVER_FLAG_ATTR;
+	}
+
+	return error;
 }
 
 static void vtconsole_deinit_class_device(struct con_driver *con)
 {
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
-		class_device_remove_file(con->class_dev,
-					 &class_device_attrs[i]);
+	if (con->flag & CON_DRIVER_FLAG_ATTR) {
+		for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
+			class_device_remove_file(con->class_dev,
+						 &class_device_attrs[i]);
+		con->flag &= ~CON_DRIVER_FLAG_ATTR;
+	}
 }
 
 /**
@@ -3184,6 +3200,7 @@ int register_con_driver(const struct con
 	} else {
 		vtconsole_init_class_device(con_driver);
 	}
+
 err:
 	release_console_sem();
 	module_put(owner);
_

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

origin.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