Linux EFI development
 help / color / mirror / Atom feed
* [PATCH] efi: fix always unregister kset of efivars in register_efivars
@ 2012-10-29  6:52 Lee, Chun-Yi
       [not found] ` <1351493576-3094-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lee, Chun-Yi @ 2012-10-29  6:52 UTC (permalink / raw)
  To: matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy
  Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi, Matthew Garrett,
	H. Peter Anvin, Jeremy Kerr, Matt Fleming

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 <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Cc: Jeremy Kerr <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-30  3:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29  6:52 [PATCH] efi: fix always unregister kset of efivars in register_efivars Lee, Chun-Yi
     [not found] ` <1351493576-3094-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
2012-10-29 19:11   ` Matt Fleming
     [not found]     ` <1351537904.14888.44.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2012-10-30  3:07       ` joeyli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox