Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185144
b: refs/heads/master
c: dce46a0
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Mar 2, 2010
1 parent 6ac0a80 commit 0b21f12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81d0d950e5037a26b71e568ff235ff9e998f4ab3
refs/heads/master: dce46a04d55d6358d2d4ab44a4946a19f9425fe2
14 changes: 12 additions & 2 deletions trunk/kernel/early_res.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,19 @@ static void __init drop_range_partial(int i, u64 start, u64 end)
/* make head segment */
early_res[i].end = common_start;
if (old_end > common_end) {
char name[15];

/*
* Save a local copy of the name, since the
* early_res array could get resized inside
* reserve_early_without_check() ->
* __check_and_double_early_res(), which would
* make the current name pointer invalid.
*/
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 {
Expand Down

0 comments on commit 0b21f12

Please sign in to comment.