提交 4ad5e883 编写于 作者: A Andrew Donnellan 提交者: Michael Ellerman

powerpc/mpic: handle subsys_system_register() failure

mpic_init_sys() currently doesn't check whether
subsys_system_register() succeeded or not. Check the return code of
subsys_system_register() and clean up if there's an error.
Signed-off-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 2d521784
......@@ -2004,8 +2004,15 @@ static struct syscore_ops mpic_syscore_ops = {
static int mpic_init_sys(void)
{
int rc;
register_syscore_ops(&mpic_syscore_ops);
subsys_system_register(&mpic_subsys, NULL);
rc = subsys_system_register(&mpic_subsys, NULL);
if (rc) {
unregister_syscore_ops(&mpic_syscore_ops);
pr_err("mpic: Failed to register subsystem!\n");
return rc;
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册