public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: jbarnes@sgi.com (Jesse Barnes)
To: linux-ia64@vger.kernel.org
Subject: [PATCH] zero out topology related sysfs nodes
Date: Mon, 20 Oct 2003 20:35:37 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106668318400859@msgid-missing> (raw)

Tony pointed out (thanks Tony!) that in -test8 kobject_set_name() will
try to free a kobject's k_name field if it's non-NULL, so we need to
zero it out in case kmalloc() gave us recycled memory or we'll try to
kfree a bogus area.

Jesse

 -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
--- a/arch/ia64/mm/numa.c	Mon Oct 20 13:23:40 2003
+++ b/arch/ia64/mm/numa.c	Mon Oct 20 13:23:40 2003
@@ -60,6 +60,7 @@
 		err = -ENOMEM;
 		goto out;
 	}
+	memset(sysfs_nodes, 0, sizeof(struct node) * numnodes);
 
 	sysfs_memblks = kmalloc(sizeof(struct memblk) * num_memblks,
 				GFP_KERNEL);
@@ -68,6 +69,7 @@
 		err = -ENOMEM;
 		goto out;
 	}
+	memset(sysfs_memblks, 0, sizeof(struct memblk) * num_memblks);
 
 	sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL);
 	if (!sysfs_cpus) {
@@ -76,6 +78,7 @@
 		err = -ENOMEM;
 		goto out;
 	}
+	memset(sysfs_cpus, 0, sizeof(struct cpu) * NR_CPUS);
 
 	for (i = 0; i < numnodes; i++)
 		if ((err = register_node(&sysfs_nodes[i], i, 0)))

                 reply	other threads:[~2003-10-20 20:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=marc-linux-ia64-106668318400859@msgid-missing \
    --to=jbarnes@sgi.com \
    --cc=linux-ia64@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