Skip to content

Commit 0a1be15

Browse files
Toshi Kanitorvalds
authored andcommitted
mm/memory_hotplug.c: fix return value of online_pages()
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> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5f12733 commit 0a1be15

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎mm/memory_hotplug.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,19 +914,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
914914
if ((zone_idx(zone) > ZONE_NORMAL || online_type == ONLINE_MOVABLE) &&
915915
!can_online_high_movable(zone)) {
916916
unlock_memory_hotplug();
917-
return -1;
917+
return -EINVAL;
918918
}
919919

920920
if (online_type == ONLINE_KERNEL && zone_idx(zone) == ZONE_MOVABLE) {
921921
if (move_pfn_range_left(zone - 1, zone, pfn, pfn + nr_pages)) {
922922
unlock_memory_hotplug();
923-
return -1;
923+
return -EINVAL;
924924
}
925925
}
926926
if (online_type == ONLINE_MOVABLE && zone_idx(zone) == ZONE_MOVABLE - 1) {
927927
if (move_pfn_range_right(zone, zone + 1, pfn, pfn + nr_pages)) {
928928
unlock_memory_hotplug();
929-
return -1;
929+
return -EINVAL;
930930
}
931931
}
932932

0 commit comments

Comments
 (0)