
From: "Randy.Dunlap" <rddunlap@osdl.org>

EFI-enabled kernels crash on non-EFI machines.  efivars_init() and
efivars_exit() need to check efi_enabled instead of assuming that the
system is using EFI.


---

 25-akpm/drivers/firmware/efivars.c |    6 ++++++
 1 files changed, 6 insertions(+)

diff -puN drivers/firmware/efivars.c~efivars-fix drivers/firmware/efivars.c
--- 25/drivers/firmware/efivars.c~efivars-fix	2004-05-10 21:26:44.416473280 -0700
+++ 25-akpm/drivers/firmware/efivars.c	2004-05-10 21:26:44.420472672 -0700
@@ -664,6 +664,9 @@ efivars_init(void)
 	unsigned long variable_name_size = 1024;
 	int i, rc = 0, error = 0;
 
+	if (!efi_enabled)
+		return -ENODEV;
+
 	printk(KERN_INFO "EFI Variables Facility v%s\n", EFIVARS_VERSION);
 
 	/*
@@ -733,6 +736,9 @@ efivars_exit(void)
 {
 	struct list_head *pos, *n;
 
+	if (!efi_enabled)
+		return;
+
 	list_for_each_safe(pos, n, &efivar_list)
 		efivar_unregister(get_efivar_entry(pos));
 

_
