Commit e916ad29 authored by Tejun Heo's avatar Tejun Heo Committed by 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: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment