tracing: Handle tracing_map_alloc_elts() error path correctly
authorTom Zanussi <tom.zanussi@linux.intel.com>
Mon, 25 Apr 2016 19:01:28 +0000 (14:01 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 26 Apr 2016 13:40:30 +0000 (09:40 -0400)
commit6e4cf657defa8fb06dbf9ed91adb78414758f259
treeef8006ad1e5de0108098758f652d10ceab55cb17
parent432480c58219eff32904b879eb3fcc1d268a3b06
tracing: Handle tracing_map_alloc_elts() error path correctly

If tracing_map_elt_alloc() fails, it will return ERR_PTR() instead of
NULL, so change the check to IS_ERROR().  We also need to set the
failed entry in the map->elts array to NULL instead of ERR_PTR() so
tracing_map_free_elts() doesn't try freeing an ERR_PTR().

tracing_map_free_elts() should also zero out what it frees so a
reentrant call won't find previously freed elements.

Link: http://lkml.kernel.org/r/f29d03b00bce3aac8cf151a8a30e6c83e5fee66d.1461610073.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/tracing_map.c