Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284419
b: refs/heads/master
c: 6480e5a
h: refs/heads/master
i:
  284417: afc7a04
  284415: c7a42c4
v: v3
  • Loading branch information
Michael Holzheu authored and Linus Torvalds committed Jan 13, 2012
1 parent 449bad8 commit c03b9e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3dd3323058d281abd584b15ad4c5b65064d7a61
refs/heads/master: 6480e5a0923756b500634d9777ec4189492fbbfe
15 changes: 15 additions & 0 deletions trunk/kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ int crash_shrink_memory(unsigned long new_size)
{
int ret = 0;
unsigned long start, end;
struct resource *ram_res;

mutex_lock(&kexec_mutex);

Expand All @@ -1146,6 +1147,12 @@ int crash_shrink_memory(unsigned long new_size)
goto unlock;
}

ram_res = kzalloc(sizeof(*ram_res), GFP_KERNEL);
if (!ram_res) {
ret = -ENOMEM;
goto unlock;
}

start = roundup(start, KEXEC_CRASH_MEM_ALIGN);
end = roundup(start + new_size, KEXEC_CRASH_MEM_ALIGN);

Expand All @@ -1154,7 +1161,15 @@ int crash_shrink_memory(unsigned long new_size)

if ((start == end) && (crashk_res.parent != NULL))
release_resource(&crashk_res);

ram_res->start = end;
ram_res->end = crashk_res.end;
ram_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
ram_res->name = "System RAM";

crashk_res.end = end - 1;

insert_resource(&iomem_resource, ram_res);
crash_unmap_reserved_pages();

unlock:
Expand Down

0 comments on commit c03b9e3

Please sign in to comment.