Re: [PATCH 2/5] tracing: add tracer dependent options to optionsdirectory

From: Steven Rostedt
Date: Fri Feb 27 2009 - 09:46:43 EST



On Thu, 26 Feb 2009, Andrew Morton wrote:

> On Fri, 27 Feb 2009 00:34:12 -0500 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > + topts = kzalloc(sizeof(*topts) * (cnt + 1), GFP_KERNEL);
>
> nit: kcalloc() checks for multiplicative overflow, whereas the above
> does not. It sets a good example ;)

Thanks, I'll have to add that to my clean ups. I originally had it as
kmalloc, and just set the last entry to NULL by hand. Then I realized
that if an error happened during initialization of one of the entries, it
may not be NULL, so I went back and changed it to kzalloc, never thinking
about kcalloc.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/