blkcg: add missing NULL check in ioc_cpd_alloc()

ioc_cpd_alloc() forgot to check NULL return from kzalloc().  Add it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Tejun Heo 2019-08-30 06:10:58 -07:00 committed by Jens Axboe
parent 3532e72272
commit e916ad29d9

View File

@ -1888,8 +1888,10 @@ static struct blkcg_policy_data *ioc_cpd_alloc(gfp_t gfp)
struct ioc_cgrp *iocc; struct ioc_cgrp *iocc;
iocc = kzalloc(sizeof(struct ioc_cgrp), gfp); 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; return &iocc->cpd;
} }