Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422761AbYHFUhW (ORCPT ); Wed, 6 Aug 2008 16:37:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758179AbYHFUhF (ORCPT ); Wed, 6 Aug 2008 16:37:05 -0400 Received: from relay1.sgi.com ([192.48.171.29]:59848 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758991AbYHFUhD (ORCPT ); Wed, 6 Aug 2008 16:37:03 -0400 Date: Wed, 6 Aug 2008 15:37:00 -0500 From: Paul Jackson To: Max Krasnyansky Cc: rakib.mullick@gmail.com, menage@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpuset : Handling improper memory allocation. Message-Id: <20080806153700.dc12e5dc.pj@sgi.com> In-Reply-To: <489A05EF.7000108@qualcomm.com> References: <489A05EF.7000108@qualcomm.com> Organization: SGI X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.12.0; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 891 Lines: 23 Max wrote: > partition_sched_domains() can deal with attrs==NULL case. So we do not > have to abort domain building. This might be a good place for a comment, since unchecked kmalloc() calls look dangerous: /* Convert to */ doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL); if (!doms) goto rebuild; dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL); /* dattr == NULL is ok; partition_sched_domains() can cope with it. */ -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson 1.940.382.4214 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/