* [PATCH] block-throttle: set q->td to NULL if blkcg_activate_policy failed
@ 2020-08-05 13:37 Zheng Bin
0 siblings, 0 replies; only message in thread
From: Zheng Bin @ 2020-08-05 13:37 UTC (permalink / raw)
To: tj, axboe, cgroups, linux-block; +Cc: yi.zhang, zhengbin13
Otherwise q->td will point to the released memory, although there is
no access to q->td in the following process, still recommend to do this.
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
block/blk-throttle.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index fee3325edf27..05b87516eee9 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -2399,6 +2399,7 @@ int blk_throtl_init(struct request_queue *q)
free_percpu(td->latency_buckets[READ]);
free_percpu(td->latency_buckets[WRITE]);
kfree(td);
+ q->td = NULL;
}
return ret;
}
--
2.25.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-05 17:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 13:37 [PATCH] block-throttle: set q->td to NULL if blkcg_activate_policy failed Zheng Bin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).