Message ID | 20221018145135.932240-3-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 f07a03c1e052..030e5716661e 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -387,6 +387,7 @@ static int blk_trace_stop(struct blk_trace *bt) static void blk_trace_cleanup(struct request_queue *q, struct blk_trace *bt) { + blk_trace_stop(bt); synchronize_rcu(); blk_trace_free(q, bt); put_probe_ref(); @@ -401,8 +402,7 @@ static int __blk_trace_remove(struct request_queue *q) if (!bt) return -EINVAL; - if (bt->trace_state != Blktrace_running) - blk_trace_cleanup(q, bt); + blk_trace_cleanup(q, bt); return 0; }