Messages in this thread Patch in this message | | | Date | Mon, 01 Mar 2010 18:48:52 -0800 | From | Yinghai Lu <> | Subject | [PATCH] early_res: need to save name aside with free_early_partial |
| |
noticed some early_res got blank name.
it turns out reserve_early_without_check could update allocate new early_res and copy old early_res already. so can not take early_res as parameter.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
--- kernel/early_res.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Index: linux-2.6/kernel/early_res.c =================================================================== --- linux-2.6.orig/kernel/early_res.c +++ linux-2.6/kernel/early_res.c @@ -79,9 +79,16 @@ static void __init drop_range_partial(in /* make head segment */ early_res[i].end = common_start; if (old_end > common_end) { + char name[15]; + + /* + * Save name aside, in reserve_early_ have allocated + * and new early_res array because auto double + */ + strncpy(name, early_res[i].name, + sizeof(early_res[i].name) - 1); /* add another for left over on tail */ - reserve_early_without_check(common_end, old_end, - early_res[i].name); + reserve_early_without_check(common_end, old_end, name); } return; } else {
| |