lkml.org 
[lkml]   [2008]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpuset : Handling improper memory allocation.
Paul Jackson wrote:
> 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 <csn, csa> to <ndoms, doms> */
> 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. */

Makes sense. I'll add it, since I'm touching that area anyway.

Max




\
 
 \ /
  Last update: 2008-08-06 22:47    [W:0.026 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site