efi/pstore: Return error code (if any) from efi_pstore_write()
authorEvgeny Kalugin <evgeny.kalugin@intel.com>
Tue, 4 Apr 2017 16:02:42 +0000 (17:02 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 5 Apr 2017 10:27:25 +0000 (12:27 +0200)
For some reason return value from actual variable setting was ignored.
With this change error code get transferred upwards through call stack.

Signed-off-by: Evgeny Kalugin <evgeny.kalugin@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170404160245.27812-9-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/efi-pstore.c

index f402ba2eed46461d0402c403db87b9a017399659..6b5acefce6b360fdb74f72cffa857bb75295ecb8 100644 (file)
@@ -274,9 +274,9 @@ static int efi_pstore_write(enum pstore_type_id type,
        for (i = 0; i < DUMP_NAME_LEN; i++)
                efi_name[i] = name[i];
 
-       efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
-                             !pstore_cannot_block_path(reason),
-                             size, psi->buf);
+       ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
+                                   !pstore_cannot_block_path(reason),
+                                   size, psi->buf);
 
        if (reason == KMSG_DUMP_OOPS)
                efivar_run_worker();