setup_data: if nothing to load and version < 2.09, no harm no foul
authorH. Peter Anvin <hpa@linux.intel.com>
Fri, 29 Jun 2012 22:46:27 +0000 (15:46 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 29 Jun 2012 22:46:27 +0000 (15:46 -0700)
If the setup_data is empty, it is okay if the version is < 2.09.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
com32/lib/syslinux/load_linux.c

index 622c2ab..856141f 100644 (file)
@@ -462,15 +462,15 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
            addr_t best_addr = 0;
            size_t size = sdp->hdr.len + sizeof(sdp->hdr);
 
+           if (!sdp->data || !sdp->hdr.len)
+               continue;
+
            if (hdr.version < 0x0209) {
                /* Setup data not supported */
                errno = ENXIO;  /* Kind of arbitrary... */
                goto bail;
            }
 
-           if (!sdp->data || !sdp->hdr.len)
-               continue;
-
            for (ml = amap; ml->type != SMT_END; ml = ml->next) {
                addr_t adj_start = (ml->start + align_mask) & ~align_mask;
                addr_t adj_end = ml->next->start & ~align_mask;