mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rakib Mullick" <rakib.mullick@gmail.com>
To: pj@sgi.com, menage@google.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] cpuset : Handling improper memory allocation.
Date: Wed, 6 Aug 2008 23:22:33 +0600	[thread overview]
Message-ID: <b9df5fa10808061022r34e3a009k5060c8fab06bcd5c@mail.gmail.com> (raw)

This patch makes sure that , if kmalloc fails in
"rebuild_sched_domains", then we've a place to go. If anything else,
please let me know.

Thanks.

Signed-off-by: Md.Rakib H. Mullick (rakib.mullick@gmail.com)

--- linux-2.6.27-rc2.orig/kernel/cpuset.c	2008-08-06 16:23:26.000000000 +0600
+++ linux-2.6.27-rc2/kernel/cpuset.c	2008-08-06 23:07:59.504441992 +0600
@@ -615,7 +615,8 @@ void rebuild_sched_domains(void)
 		if (dattr) {
 			*dattr = SD_ATTR_INIT;
 			update_domain_attr_tree(dattr, &top_cpuset);
-		}
+		} else
+			goto rebuild;
 		*doms = top_cpuset.cpus_allowed;
 		goto rebuild;
 	}
@@ -685,6 +686,8 @@ restart:
 	if (!doms)
 		goto rebuild;
 	dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL);
+	if (!dattr)
+		goto rebuild;

 	for (nslot = 0, i = 0; i < csn; i++) {
 		struct cpuset *a = csa[i];

             reply	other threads:[~2008-08-06 17:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 17:22 Rakib Mullick [this message]
2008-08-06 20:13 ` Max Krasnyansky
2008-08-06 20:37   ` Paul Jackson
2008-08-06 20:43     ` Max Krasnyansky

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=b9df5fa10808061022r34e3a009k5060c8fab06bcd5c@mail.gmail.com \
    --to=rakib.mullick@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=pj@sgi.com \
    /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

all inboxes | Powered by JetHome®