lkml.org 
[lkml]   [2004]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] cpumask 5/10 rewrite cpumask.h - single bitmap based implementation
On Fri, Jun 04, 2004 at 11:38:15AM -0700, William Lee Irwin III wrote:
> if (!realloc(cpus, 2*upper))
> - return -ENOMEM;
> + goto out;

... and as someone pointed out:


--- nr_cpus.c.orig3 2004-06-04 19:49:15.000000000 -0700
+++ nr_cpus.c 2004-06-04 19:49:31.000000000 -0700
@@ -24,12 +24,12 @@
if (!cpus)
return -ENOMEM;
for (upper = lower; getaffinity(0, upper, cpus) < 0; upper *= 2) {
- if (!realloc(cpus, 2*upper))
+ if (!(cpus = realloc(cpus, 2*upper)))
goto out;
}
while (lower < upper - 1) {
middle = (lower + upper)/2;
- if (!realloc(cpus, middle))
+ if (!(cpus = realloc(cpus, middle)))
goto out;
if (getaffinity(0, middle, cpus) < 0)
lower = middle;
-
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/
\
 
 \ /
  Last update: 2005-03-22 14:03    [from the cache]
©2003-2011 Jasper Spaans