Skip to content

Commit

Permalink
powerpc/pseries: Fix error return value in cmm_mem_going_offline()
Browse files Browse the repository at this point in the history
cmm_mem_going_offline() is (only) called from cmm_memory_cb(), which
sends the return value through notifier_from_errno(). The latter
expects 0 or -errno (notifier_to_errno(notifier_from_errno(x)) is 0
for any x >= 0, so passing a positive value cannot make sense). Hence
negate ENOMEM.

Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
Villemoes authored and mpe committed Jul 5, 2016
1 parent a9862c7 commit e2be237
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/cmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static int cmm_mem_going_offline(void *arg)
cmm_dbg("Failed to allocate memory for list "
"management. Memory hotplug "
"failed.\n");
return ENOMEM;
return -ENOMEM;
}
memcpy(npa, pa_curr, PAGE_SIZE);
if (pa_curr == cmm_page_list)
Expand Down

0 comments on commit e2be237

Please sign in to comment.