summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-01-09 03:53:24 +0100
committerMichael Brown2007-01-09 03:53:24 +0100
commited44e3730d73d1ccc7aa045a57cd8d2b0a14eb47 (patch)
tree4b9c552200fcd63918d845ad8229f078adefb6dc
parentAvoid leaving preloaded_undi with invalid PXENV+/!PXE structure (diff)
downloadipxe-ed44e3730d73d1ccc7aa045a57cd8d2b0a14eb47.tar.gz
ipxe-ed44e3730d73d1ccc7aa045a57cd8d2b0a14eb47.tar.xz
ipxe-ed44e3730d73d1ccc7aa045a57cd8d2b0a14eb47.zip
Avoid erasing non-existent signatures in undi_unload()
-rw-r--r--src/arch/i386/drivers/net/undiload.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/arch/i386/drivers/net/undiload.c b/src/arch/i386/drivers/net/undiload.c
index 7ae62480d..a0669d959 100644
--- a/src/arch/i386/drivers/net/undiload.c
+++ b/src/arch/i386/drivers/net/undiload.c
@@ -170,8 +170,10 @@ int undi_unload ( struct undi_device *undi ) {
DBGC ( undi, "UNDI %p unloading\n", undi );
/* Erase signatures */
- put_real ( dead, undi->pxenv.segment, undi->pxenv.offset );
- put_real ( dead, undi->ppxe.segment, undi->ppxe.offset );
+ if ( undi->pxenv.segment )
+ put_real ( dead, undi->pxenv.segment, undi->pxenv.offset );
+ if ( undi->ppxe_segment )
+ put_real ( dead, undi->ppxe.segment, undi->ppxe.offset );
/* Free base memory, if possible */
get_real ( fbms, BDA_SEG, BDA_FBMS );