efi, pstore: Read data from variable store before memcpy()
commit8a415b8c05f261a52f45f2271b6c4731376fd5b5
authorMatt Fleming <matt.fleming@intel.com>
Mon, 29 Apr 2013 19:08:02 +0000 (29 20:08 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 30 Apr 2013 15:03:10 +0000 (30 16:03 +0100)
treede233c9382c3f4a08fcdd1b26be38810fdf2ce25
parent12abcfde1ad3ee9bed726d25fdd4eeb31026b187
efi, pstore: Read data from variable store before memcpy()

Seiji reported getting empty dmesg-* files, because the data was never
actually read in efi_pstore_read_func(), and so the memcpy() was copying
garbage data.

This patch necessitated adding __efivar_entry_get() which is callable
between efivar_entry_iter_{begin,end}(). We can also delete
__efivar_entry_size() because efi_pstore_read_func() was the only
caller.

Reported-by: Seiji Aguchi <seiji.aguchi@hds.com>
Tested-by: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efi/efi-pstore.c
drivers/firmware/efi/vars.c
include/linux/efi.h