Skip to content

Commit

Permalink
tracing: replace kzalloc with kcalloc
Browse files Browse the repository at this point in the history
Impact: clean up

kcalloc is a better approach to allocate a NULL array.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Feb 27, 2009
1 parent 5c6a3ae commit 0cfe824
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3328,7 +3328,7 @@ create_trace_option_files(struct tracer *tracer)
for (cnt = 0; opts[cnt].name; cnt++)
;

topts = kzalloc(sizeof(*topts) * (cnt + 1), GFP_KERNEL);
topts = kcalloc(cnt + 1, sizeof(*topts), GFP_KERNEL);
if (!topts)
return NULL;

Expand Down

0 comments on commit 0cfe824

Please sign in to comment.