summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-07-11 08:30:33 +0200
committerMatt Fleming <matt.fleming@intel.com>2013-07-11 12:00:31 +0200
commitd320c079efd46db1be0640d00bd6723d9e738f9f (patch)
treea7569a0740d894e36e845971f9de35c3d9363b3c /drivers/firmware
parentRevert "Makefile: Fix install error with make -j option" (diff)
downloadlinux-d320c079efd46db1be0640d00bd6723d9e738f9f.tar.xz
linux-d320c079efd46db1be0640d00bd6723d9e738f9f.zip
efivars: check for EFI_RUNTIME_SERVICES
The efivars code requires EFI runtime services to function, so check that they are enabled. This fixes a crash when booting with the "noefi" kernel parameter, and also when mixing kernel and firmware "bitness", e.g. 32-bit kernel with 64-bit firmware. Tested-by: Dave Young <dyoung@redhat.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/efivars.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 8bd1bb6dbe47..8a7432a4b413 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -583,6 +583,9 @@ int efivars_sysfs_init(void)
struct kobject *parent_kobj = efivars_kobject();
int error = 0;
+ if (!efi_enabled(EFI_RUNTIME_SERVICES))
+ return -ENODEV;
+
/* No efivars has been registered yet */
if (!parent_kobj)
return 0;