[core] properly handle failure to register hooks

This commit is contained in:
Geoffrey McRae 2020-11-11 10:58:59 +11:00
parent 34b4e4f446
commit cc8e8b3005
1 changed files with 5 additions and 1 deletions

View File

@ -161,12 +161,16 @@ static int __init vendor_reset_init(void)
{
ret = fh_install_hooks(fh_hooks);
if (ret)
return ret;
goto err;
vr_info("Hooks installed successfully\n");
}
return 0;
err:
misc_deregister(&vendor_reset_misc);
return ret;
}
static void __exit vendor_reset_exit(void)