summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweiping zhang <zhangweiping@didichuxing.com>2017-10-10 16:53:46 +0200
committerJens Axboe <axboe@kernel.dk>2017-10-10 17:04:47 +0200
commit58a9edce0aa912640abe47d3fc039e6230ef848b (patch)
tree286a3dece8b65378b1df55c0bda54f0c14871624
parentwriteback: merge try_to_writeback_inodes_sb_nr() into caller (diff)
downloadlinux-58a9edce0aa912640abe47d3fc039e6230ef848b.tar.xz
linux-58a9edce0aa912640abe47d3fc039e6230ef848b.zip
blkcg: check pol->cpd_free_fn before free cpd
check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--block/blk-cgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index d3f56baee936..e7ec676043b1 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1452,7 +1452,7 @@ int blkcg_policy_register(struct blkcg_policy *pol)
return 0;
err_free_cpds:
- if (pol->cpd_alloc_fn) {
+ if (pol->cpd_free_fn) {
list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node) {
if (blkcg->cpd[pol->plid]) {
pol->cpd_free_fn(blkcg->cpd[pol->plid]);
@@ -1492,7 +1492,7 @@ void blkcg_policy_unregister(struct blkcg_policy *pol)
/* remove cpds and unregister */
mutex_lock(&blkcg_pol_mutex);
- if (pol->cpd_alloc_fn) {
+ if (pol->cpd_free_fn) {
list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node) {
if (blkcg->cpd[pol->plid]) {
pol->cpd_free_fn(blkcg->cpd[pol->plid]);