1
0
Fork 0

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: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
hifive-unleashed-5.1
Andrew Donnellan 2016-04-26 17:55:04 +10:00 committed by Michael Ellerman
parent 2d5217840f
commit 4ad5e8831e
1 changed files with 8 additions and 1 deletions

View File

@ -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;
}