From d92b0c01d42236af68839e0c6360b3a44478b0a0 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 16 Jan 2010 12:55:52 +0100 Subject: [PATCH] Fixed knetbsd misbehaviour when no module is loaded --- loader/i386/bsd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index f93c87cf0..43c2c129b 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -922,23 +922,18 @@ grub_netbsd_add_modules (void) struct netbsd_module *mod; unsigned modcnt = 0; struct grub_netbsd_btinfo_modules *mods; - grub_addr_t last_addr = 0; unsigned i; grub_err_t err; for (mod = netbsd_mods; mod; mod = mod->next) - { - if (mod->mod.addr + mod->mod.size > last_addr) - last_addr = mod->mod.addr + mod->mod.size; - modcnt++; - } + modcnt++; mods = grub_malloc (sizeof (*mods) + sizeof (mods->mods[0]) * modcnt); if (!mods) return grub_errno; mods->num = modcnt; - mods->last_addr = last_addr; + mods->last_addr = kern_end; for (mod = netbsd_mods, i = 0; mod; i++, mod = mod->next) mods->mods[i] = mod->mod;