blktrace: fix memory leak when freeing struct blk_io_trace
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 27 Mar 2009 02:20:24 +0000 (10:20 +0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 31 Mar 2009 15:27:58 +0000 (17:27 +0200)
commitad5dd5493a55e462796e42e50a49e76df76fdb05
tree3073af1836aaa7ba1d8df4cb6b2f287b31e27d72
parent17ba97e347bec9bbc47a0877c7a098708982129d
blktrace: fix memory leak when freeing struct blk_io_trace

Impact: fix mixed ioctl and ftrace-plugin blktrace use memory leak

When mixing the use of ioctl-based blktrace and ftrace-based blktrace,
we can leak memory in this way:

  # btrace /dev/sda > /dev/null &
  # echo 0 > /sys/block/sda/sda1/trace/enable

now we leak bt->dropped_file, bt->msg_file, bt->rchan...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/blktrace.c