From: Dan Carpenter <dan.carpenter@oracle.com>
To: ebiederm@xmission.com
Cc: linux-kernel@vger.kernel.org
Subject: re: sysctl: register only tables of sysctl files
Date: Mon, 30 Jan 2012 16:39:33 +0300 [thread overview]
Message-ID: <20120130133933.GA5926@elgon.mountain> (raw)
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
next reply other threads:[~2012-01-30 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 13:39 Dan Carpenter [this message]
2012-01-30 13:49 ` sysctl: register only tables of sysctl files Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120130133933.GA5926@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).