From cc8e8b3005a3856a39f0cef7e0fe4b1490ac68e0 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 11 Nov 2020 10:58:59 +1100 Subject: [PATCH] [core] properly handle failure to register hooks --- src/vendor-reset.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vendor-reset.c b/src/vendor-reset.c index 50c85a7..405f294 100644 --- a/src/vendor-reset.c +++ b/src/vendor-reset.c @@ -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)