summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 9e9b0df339ee..4defbbabc0ff 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1083,7 +1083,8 @@ pd_prealloc:
blkg->pd[pol->plid] = pd;
pd->blkg = blkg;
pd->plid = pol->plid;
- pol->pd_init_fn(blkg);
+ if (pol->pd_init_fn)
+ pol->pd_init_fn(blkg);
}
__set_bit(pol->plid, q->blkcg_pols);