提交 e916ad29 编写于 作者: T Tejun Heo 提交者: Jens Axboe

blkcg: add missing NULL check in ioc_cpd_alloc()

ioc_cpd_alloc() forgot to check NULL return from kzalloc().  Add it.
Signed-off-by: NTejun Heo <tj@kernel.org>
Reported-by: Nkbuild test robot <lkp@intel.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 3532e722
......@@ -1888,8 +1888,10 @@ static struct blkcg_policy_data *ioc_cpd_alloc(gfp_t gfp)
struct ioc_cgrp *iocc;
iocc = kzalloc(sizeof(struct ioc_cgrp), gfp);
iocc->dfl_weight = CGROUP_WEIGHT_DFL;
if (!iocc)
return NULL;
iocc->dfl_weight = CGROUP_WEIGHT_DFL;
return &iocc->cpd;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册