Message ID | 20221018145135.932240-4-yebin@huaweicloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fix possible memleak in '__blk_trace_remove' | expand |
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 030e5716661e..2be8c747f796 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -784,10 +784,8 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) void blk_trace_shutdown(struct request_queue *q) { if (rcu_dereference_protected(q->blk_trace, - lockdep_is_held(&q->debugfs_mutex))) { - __blk_trace_startstop(q, 0); + lockdep_is_held(&q->debugfs_mutex))) __blk_trace_remove(q); - } } #ifdef CONFIG_BLK_CGROUP
As previous commit, 'blk_trace_cleanup' will stop block trace if block trace's state is 'Blktrace_running'. So remove unnessary stop block trace in 'blk_trace_shutdown'. Signed-off-by: Ye Bin <yebin@huaweicloud.com> --- kernel/trace/blktrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)