summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/firmware/efivars.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 5d1ec6898e7c..a2d2f1f0d4f3 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -827,8 +827,10 @@ err_put:
static void __exit
efivars_exit(void)
{
- unregister_efivars(&__efivars);
- kobject_put(efi_kobj);
+ if (efi_enabled) {
+ unregister_efivars(&__efivars);
+ kobject_put(efi_kobj);
+ }
}
module_init(efivars_init);