Skip to contentSkip to conversation

efi: fix always unregister kset of efivars in register_efivars

PATCH In review Lee, Chun-Yi 3 participants 3 messages Oct 29, 2012 – Oct 30, 2012 2 messages not in the archive EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: fix always unregister kset of efivars in register_efivars

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]>
---
 drivers/firmware/efivars.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/firmware/efivars.c +2 -4
index 03e0df2..8870907 100644
@@ -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);
 
Signature · 1 line
1.6.0.2
#2 lore raw
In reply to a message not in the archive
Quoted 6 lines · Chun-Yi

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.

Quoted 8 lines
Cc Matthew Garrett <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jeremy Kerr <[email protected]>
Cc Matt Fleming <[email protected]>
---
 drivers/firmware/efivars.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Thanks Joey. What I ended up doing was squashing this patch with your previous version and rebasing my 'next' branch. That way, when this series is merged the bug will never appear.

Please take a look to make sure everything is OK.

Signature · 1 line
Matt Fleming, Intel Open Source Technology Center
#4 lore raw
In reply to a message not in the archive

於 一,2012-10-29 於 19:11 +0000,Matt Fleming 提到:

Quoted 16 lines · Chun-Yi
Quoted 6 lines

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.

Quoted 8 lines
Cc Matthew Garrett <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jeremy Kerr <[email protected]>
Cc Matt Fleming <[email protected]>
---
 drivers/firmware/efivars.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
Quoted 6 lines

Thanks Joey. What I ended up doing was squashing this patch with your previous version and rebasing my 'next' branch. That way, when this series is merged the bug will never appear.

Please take a look to make sure everything is OK.

I just check the next branch, this fix merged with patch commit eecceeb, everything is OK.

Thanks a lot!
Joey Lee