From: Steven Rostedt (Red Hat) Date: Fri, 6 Jun 2014 04:01:46 +0000 (-0400) Subject: tracing: Fix leak of ring buffer data when new instances creation fails X-Git-Tag: omap-for-v3.16/fixes-against-rc1~80^2~1 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23aaa3c18e33fe048671b419781b5e44175efafe;p=pandora-kernel.git tracing: Fix leak of ring buffer data when new instances creation fails Yoshihiro Yunomae reported that the ring buffer data for a trace instance does not get properly cleaned up when it fails. He proposed a patch that manually cleaned the data up and addad a bunch of labels. The labels are not needed because all trace array is allocated with a kzalloc which initializes it to 0 and all kfree()s can take a NULL pointer and will ignore it. Adding a new helper function free_trace_buffers() that can also take null buffers to free the buffers that were allocated by allocate_trace_buffers(). Link: http://lkml.kernel.org/r/20140605223522.32311.31664.stgit@yunodevel Reported-by: Yoshihiro YUNOMAE Signed-off-by: Steven Rostedt --- Reading git-diff-tree failed