Commit e916ad29 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
}