The cc9c97b76aa7235d5a1de0f74f990097f77008b4 patch introduced a
issue that always unregister kset of efivars in register_efivars.

This patch moved the kset_unregister function call to the kobject create check
block for fix issue.

Cc: Matthew Garrett <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jeremy Kerr <[email protected]>
Cc: Matt Fleming <[email protected]>
Signed-off-by: Lee, Chun-Yi <[email protected]>
---
 drivers/firmware/efivars.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 03e0df2..8870907 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -1595,7 +1595,8 @@ int register_efivars(struct efivars *efivars,
        if (!efivars->kobject) {
                pr_err("efivars: Subsystem registration failed.\n");
                error = -ENOMEM;
-               goto err_unreg_vars;
+               kset_unregister(efivars->kset);
+               goto out;
        }
 
        /*
@@ -1642,9 +1643,6 @@ int register_efivars(struct efivars *efivars,
 
        register_filesystem(&efivarfs_type);
 
-err_unreg_vars:
-       kset_unregister(efivars->kset);
-
 out:
        kfree(variable_name);
 
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to