[v3,0/3] fix possible memleak in '__blk_trace_remove'

Message ID 20221019033602.752383-1-yebin@huaweicloud.com
Headers
Series fix possible memleak in '__blk_trace_remove' |

Message

Ye Bin Oct. 19, 2022, 3:35 a.m. UTC
  From: Ye Bin <yebin10@huawei.com>

Diff v3 VS v2
1. Invert the check of 'blk_trace_{start,stop}' and return early from the
function for the error case.

Diff v2 VS v1:
1. Introduce 'blk_trace_{start,stop}' helper instead of 'blk_trace_switch_state'.
2. Move stop block trace from '__blk_trace_remove' to 'blk_trace_cleanup'.

Ye Bin (3):
  blktrace: introduce 'blk_trace_{start,stop}' helper
  blktrace: fix possible memleak in '__blk_trace_remove'
  blktrace: remove unnessary stop block trace in 'blk_trace_shutdown'

 kernel/trace/blktrace.c | 82 ++++++++++++++++++++---------------------
 1 file changed, 39 insertions(+), 43 deletions(-)
  

Comments

Jens Axboe Oct. 20, 2022, 1:03 p.m. UTC | #1
On Wed, 19 Oct 2022 11:35:59 +0800, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
> 
> Diff v3 VS v2
> 1. Invert the check of 'blk_trace_{start,stop}' and return early from the
> function for the error case.
> 
> Diff v2 VS v1:
> 1. Introduce 'blk_trace_{start,stop}' helper instead of 'blk_trace_switch_state'.
> 2. Move stop block trace from '__blk_trace_remove' to 'blk_trace_cleanup'.
> 
> [...]

Applied, thanks!

[1/3] blktrace: introduce 'blk_trace_{start,stop}' helper
      commit: 60a9bb9048f9e95029df10a9bc346f6b066c593c
[2/3] blktrace: fix possible memleak in '__blk_trace_remove'
      commit: dcd1a59c62dc49da75539213611156d6db50ab5d
[3/3] blktrace: remove unnessary stop block trace in 'blk_trace_shutdown'
      commit: 2db96217e7e515071726ca4ec791742c4202a1b2

Best regards,