From: Tejun Heo Date: Tue, 18 Aug 2015 21:55:10 +0000 (-0700) Subject: blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3e41871046bfe0ba7d122a1f14f0c1db2dca0256;p=openwrt%2Fstaging%2Fblogic.git blkcg: make blkcg_activate_policy() allow NULL ->pd_init_fn blkg_create() allows NULL ->pd_init_fn() but blkcg_activate_policy() doesn't. As both in-kernel policies implement ->pd_init_fn, it currently doesn't break anything. Update blkcg_activate_policy() so that its behavior is consistent with blkg_create(). Signed-off-by: Tejun Heo Cc: Vivek Goyal Signed-off-by: Jens Axboe --- 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);