powerpc/pseries/cmm: Report errors when registering notifiers fails

If we don't set the rc, we will return "0", making it look like we
succeeded.

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191031142933.10779-3-david@redhat.com
This commit is contained in:
David Hildenbrand 2019-10-31 15:29:23 +01:00 committed by Michael Ellerman
parent 7d82127474
commit 022da22318

View file

@ -683,8 +683,12 @@ static int cmm_init(void)
if ((rc = cmm_sysfs_register(&cmm_dev))) if ((rc = cmm_sysfs_register(&cmm_dev)))
goto out_reboot_notifier; goto out_reboot_notifier;
if (register_memory_notifier(&cmm_mem_nb) || rc = register_memory_notifier(&cmm_mem_nb);
register_memory_isolate_notifier(&cmm_mem_isolate_nb)) if (rc)
goto out_unregister_notifier;
rc = register_memory_isolate_notifier(&cmm_mem_isolate_nb);
if (rc)
goto out_unregister_notifier; goto out_unregister_notifier;
if (cmm_disabled) if (cmm_disabled)