memscan: use the contents of the ebda_seg, not the pointer itself
authorH. Peter Anvin <hpa@zytor.com>
Wed, 29 Apr 2009 05:01:48 +0000 (22:01 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 29 Apr 2009 05:01:48 +0000 (22:01 -0700)
Use the contents of the ebda_seg variable, not the address...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/syslinux/memscan.c

index dadafd0..1f9bd8a 100644 (file)
@@ -64,7 +64,7 @@ int syslinux_scan_memory(scan_memory_callback_t callback, void *data)
   dosmem = oreg.eax.w[0] << 10;
   if (dosmem < 32*1024 || dosmem > 640*1024) {
     /* INT 12h reports nonsense... now what? */
-    uint16_t ebda_seg = (uint16_t *)0x40e;
+    uint16_t ebda_seg = *(uint16_t *)0x40e;
     if (ebda_seg >= 0x8000 && ebda_seg < 0xa000)
       dosmem = ebda_seg << 4;
     else