x86/microcode/core: Return an error only when necessary
authorBorislav Petkov (AMD) <bp@alien8.de>
Mon, 30 Jan 2023 12:48:04 +0000 (13:48 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 6 Feb 2023 12:41:31 +0000 (13:41 +0100)
Return an error from the late loading function which is run on each CPU
only when an error has actually been encountered during the update.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230130161709.11615-5-bp@alien8.de
arch/x86/kernel/cpu/microcode/core.c

index ddc0958428a50a2323b35e66c353dff6b8ec31ed..7a329e5613544b078231bf66d3f2c318aaf035d6 100644 (file)
@@ -409,10 +409,10 @@ static int __reload_late(void *info)
                goto wait_for_siblings;
 
        if (err >= UCODE_NFOUND) {
-               if (err == UCODE_ERROR)
+               if (err == UCODE_ERROR) {
                        pr_warn("Error reloading microcode on CPU %d\n", cpu);
-
-               ret = -1;
+                       ret = -1;
+               }
        }
 
 wait_for_siblings: