[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120130133933.GA5926@elgon.mountain>
Date: Mon, 30 Jan 2012 16:39:33 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: ebiederm@...ssion.com
Cc: linux-kernel@...r.kernel.org
Subject: re: sysctl: register only tables of sysctl files
Hi Eric,
The patch f728019bb72e: "sysctl: register only tables of sysctl
files" from Jan 22, 2012, has a weird thing going on and I don't know
how to fix it:
+ if (nr_dirs && nr_files) {
+ struct ctl_table *new;
+ files = kzalloc(sizeof(struct ctl_table) * (nr_files + 1),
+ GFP_KERNEL);
+ if (!files)
+ goto out;
+
+ ctl_table_arg = files;
+ for (new = files, entry = table; entry->procname; entry++) {
+ if (entry->child)
+ continue;
+ *new = *entry;
+ new++;
+ }
+ }
+
+ /* Register everything except a directory full of subdirectories */
+ if (nr_files || !nr_dirs) {
+ struct ctl_table_header *header;
+ header = __register_sysctl_table(root, namespaces, path, files);
+ if (!header) {
+ kfree(ctl_table_arg);
^^^^^^^^^^^^^
+ goto out;
+ }
+
+ /* Remember if we need to free the file table */
+ header->ctl_table_arg = ctl_table_arg;
^^^^^^^^^^^^^
These are NULL unless "nr_dirs" is non-zero (so it's always NULL here).
+ **subheader = header;
+ (*subheader)++;
+ }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists