ldlinux: Don't lfree() 'kernel' twice
authorMatt Fleming <matt.fleming@intel.com>
Wed, 13 Jun 2012 14:34:14 +0000 (15:34 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Wed, 20 Jun 2012 15:35:41 +0000 (16:35 +0100)
commit7fa16f395ab5605c7e3ba414f6ab844095aec5b4
tree36dfc0f9a43b2368e2ae22eb8d9a2947da624881
parentf6e0c5e552ccbb17489097829116da03677a9270
ldlinux: Don't lfree() 'kernel' twice

This lead to serious problems where duplicate free blocks would appear
next to each other on the free list, which created an infinite loop in
the following code,

for ( fp = head->next_free ; fp != head ; fp = fp->next_free ) {
    if ( ARENA_SIZE_GET(fp->a.attrs) >= size ) {
/* Found fit -- allocate out of this block */
p = __malloc_from_block(fp, size, tag);
break;
    }
}

because fp == fp->next_free, resulting in modules hanging forever at
malloc() call sites.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/execute.c