mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
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>
(cherry picked from commit d320c079ef)
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user