aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/efidev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/efidev')
-rw-r--r--sys/dev/efidev/efirt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c
index 73e451d1c14e..2f7f5187b8fc 100644
--- a/sys/dev/efidev/efirt.c
+++ b/sys/dev/efidev/efirt.c
@@ -275,6 +275,7 @@ efi_enter(void)
{
struct thread *td;
pmap_t curpmap;
+ int error;
if (efi_runtime == NULL)
return (ENXIO);
@@ -283,7 +284,13 @@ efi_enter(void)
PMAP_LOCK(curpmap);
mtx_lock(&efi_lock);
fpu_kern_enter(td, NULL, FPU_KERN_NOCTX);
- return (efi_arch_enter());
+ error = efi_arch_enter();
+ if (error != 0) {
+ fpu_kern_leave(td, NULL);
+ mtx_unlock(&efi_lock);
+ PMAP_UNLOCK(curpmap);
+ }
+ return (error);
}
static void