diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 5 | ||||
-rw-r--r-- | drivers/base/memory.c | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 01a1bd239263..2143609d2936 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -200,8 +200,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
200 | * Note: Assume that this function returns zero on success | 200 | * Note: Assume that this function returns zero on success |
201 | */ | 201 | */ |
202 | result = add_memory(mem_device->start_addr, | 202 | result = add_memory(mem_device->start_addr, |
203 | (mem_device->end_addr - mem_device->start_addr) + 1, | 203 | (mem_device->end_addr - mem_device->start_addr) + 1); |
204 | mem_device->read_write_attribute); | ||
205 | if (result) { | 204 | if (result) { |
206 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); | 205 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); |
207 | mem_device->state = MEMORY_INVALID_STATE; | 206 | mem_device->state = MEMORY_INVALID_STATE; |
@@ -259,7 +258,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device) | |||
259 | * Ask the VM to offline this memory range. | 258 | * Ask the VM to offline this memory range. |
260 | * Note: Assume that this function returns zero on success | 259 | * Note: Assume that this function returns zero on success |
261 | */ | 260 | */ |
262 | result = remove_memory(start, len, attr); | 261 | result = remove_memory(start, len); |
263 | if (result) { | 262 | if (result) { |
264 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n")); | 263 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Hot-Remove failed.\n")); |
265 | return_VALUE(result); | 264 | return_VALUE(result); |
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 785cb6e6b91c..b7ddd651d664 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -340,15 +340,12 @@ static int memory_probe_init(void) | |||
340 | static int add_memory_block(unsigned long node_id, struct mem_section *section, | 340 | static int add_memory_block(unsigned long node_id, struct mem_section *section, |
341 | unsigned long state, int phys_device) | 341 | unsigned long state, int phys_device) |
342 | { | 342 | { |
343 | size_t size = sizeof(struct memory_block); | 343 | struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL); |
344 | struct memory_block *mem = kmalloc(size, GFP_KERNEL); | ||
345 | int ret = 0; | 344 | int ret = 0; |
346 | 345 | ||
347 | if (!mem) | 346 | if (!mem) |
348 | return -ENOMEM; | 347 | return -ENOMEM; |
349 | 348 | ||
350 | memset(mem, 0, size); | ||
351 | |||
352 | mem->phys_index = __section_nr(section); | 349 | mem->phys_index = __section_nr(section); |
353 | mem->state = state; | 350 | mem->state = state; |
354 | init_MUTEX(&mem->state_sem); | 351 | init_MUTEX(&mem->state_sem); |