提交 82baa338 编写于 作者: T Tejun Heo 提交者: Yang Yingliang

blkcg: add missing NULL check in ioc_cpd_alloc()

mainline inclusion
from mainline-5.4-rc1
commit e916ad29d96485e5aa3d3237bfeab1522c713d5e
category: feature
bugzilla: 38688
CVE: NA

---------------------------

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>
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 04342ad9
...@@ -1889,8 +1889,10 @@ static struct blkcg_policy_data *ioc_cpd_alloc(gfp_t gfp) ...@@ -1889,8 +1889,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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册