lkml.org 
[lkml]   [2007]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
Srinivasa Ds wrote:
> ---
> kernel/cpuset.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> Index: linux-2.6.22-rc3/kernel/cpuset.c
> ===================================================================
> --- linux-2.6.22-rc3.orig/kernel/cpuset.c
> +++ linux-2.6.22-rc3/kernel/cpuset.c
> @@ -1741,6 +1741,13 @@ static int cpuset_tasks_open(struct inod
> * show up until sometime later on.
> */
> npids = atomic_read(&cs->count);
> + if (!npids) {
> + ctr->buf = NULL;
> + ctr->bufsz = 0;
> + file->private_data = ctr;
> + return 0;
> + }
> +
>

I think this is a good example of why having to special-case kmalloc(0)
is a bad idea. The original code was straightforward and, barring
silliness, should be completely correct with npids==0. This new code
does nothing other than make things more complex.

J
-
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: 2007-06-01 22:33    [from the cache]
©2003-2011 Jasper Spaans