提交 0079786f 编写于 作者: Y Yunfeng Ye 提交者: Xie XiuQi

arm64: armv8_deprecated: Checking return value for memory allocation

[ Upstream commit 3e7c93bd04edfb0cae7dad1215544c9350254b8f ]

There are no return value checking when using kzalloc() and kcalloc() for
memory allocation. so add it.
Signed-off-by: NYunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: NWill Deacon <will@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5b2fd5d8
...@@ -177,6 +177,9 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops) ...@@ -177,6 +177,9 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops)
struct insn_emulation *insn; struct insn_emulation *insn;
insn = kzalloc(sizeof(*insn), GFP_KERNEL); insn = kzalloc(sizeof(*insn), GFP_KERNEL);
if (!insn)
return;
insn->ops = ops; insn->ops = ops;
insn->min = INSN_UNDEF; insn->min = INSN_UNDEF;
...@@ -236,6 +239,8 @@ static void __init register_insn_emulation_sysctl(void) ...@@ -236,6 +239,8 @@ static void __init register_insn_emulation_sysctl(void)
insns_sysctl = kcalloc(nr_insn_emulated + 1, sizeof(*sysctl), insns_sysctl = kcalloc(nr_insn_emulated + 1, sizeof(*sysctl),
GFP_KERNEL); GFP_KERNEL);
if (!insns_sysctl)
return;
raw_spin_lock_irqsave(&insn_emulation_lock, flags); raw_spin_lock_irqsave(&insn_emulation_lock, flags);
list_for_each_entry(insn, &insn_emulation, node) { list_for_each_entry(insn, &insn_emulation, node) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册