core: add missing calls to cleanup_hardware syslinux-3.83-pre10
authorH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 22:46:43 +0000 (15:46 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 22:46:43 +0000 (15:46 -0700)
As we're starting to rely more and more on a modified hardware state,
it is really important to clean up on all exit paths.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/localboot.inc
core/pxelinux.asm
core/runkernel.inc

index ae54737..6709b3b 100644 (file)
@@ -31,6 +31,9 @@ local_boot:
                mov gs,dx
                mov si,localboot_msg
                call writestr
+               push ax
+               call cleanup_hardware
+               pop ax
                cmp ax,-1
                je .int18
 
index b274514..2fb0e08 100644 (file)
@@ -864,6 +864,7 @@ local_boot:
                mov si,localboot_msg
                call writestr_early
                ; Restore the environment we were called with
+               call cleanup_hardware
                lss sp,[InitStack]
                pop gs
                pop fs
index 8bfc8b8..ac00342 100644 (file)
@@ -461,6 +461,8 @@ run_linux_kernel:
 ; Set up segment registers and the Linux real-mode stack
 ; Note: ds == the real mode segment
 ;
+               call cleanup_hardware
+
                cli
                mov ax,ds
                mov ss,ax