* [PATCH] mm/memory_hotplug.c: Fix return value of online_pages()
@ 2013-07-03 23:29 Toshi Kani
0 siblings, 0 replies; only message in thread
From: Toshi Kani @ 2013-07-03 23:29 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, isimatu.yasuaki, tangchen, Toshi Kani
online_pages() is called from memory_block_action() when a user
requests to online a memory block via sysfs. This function needs
to return a proper error value in case of error.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
mm/memory_hotplug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index cd2990f..ca1dd3a 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -914,19 +914,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
if ((zone_idx(zone) > ZONE_NORMAL || online_type == ONLINE_MOVABLE) &&
!can_online_high_movable(zone)) {
unlock_memory_hotplug();
- return -1;
+ return -EINVAL;
}
if (online_type == ONLINE_KERNEL && zone_idx(zone) == ZONE_MOVABLE) {
if (move_pfn_range_left(zone - 1, zone, pfn, pfn + nr_pages)) {
unlock_memory_hotplug();
- return -1;
+ return -EINVAL;
}
}
if (online_type == ONLINE_MOVABLE && zone_idx(zone) == ZONE_MOVABLE - 1) {
if (move_pfn_range_right(zone, zone + 1, pfn, pfn + nr_pages)) {
unlock_memory_hotplug();
- return -1;
+ return -EINVAL;
}
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-03 23:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 23:29 [PATCH] mm/memory_hotplug.c: Fix return value of online_pages() Toshi Kani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).