]> Git Repo - linux.git/commitdiff
Merge tag 'pstore-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
authorLinus Torvalds <[email protected]>
Tue, 16 May 2017 20:29:07 +0000 (13:29 -0700)
committerLinus Torvalds <[email protected]>
Tue, 16 May 2017 20:29:07 +0000 (13:29 -0700)
Pull pstore fix from Kees Cook:
 "Fix bad EFI vars iterator usage"

* tag 'pstore-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  efi-pstore: Fix read iter after pstore API refactor

1  2 
drivers/firmware/efi/efi-pstore.c

index ed3137c1ceb0c0ed0fcbb1c94bffdf1a4811bf41,44148fd4c9f241df67571d1ae10a49a5053605c5..ab3a951a17e6c182dfa1c68b579ee003b3c1c44a
@@@ -155,19 -155,14 +155,14 @@@ static int efi_pstore_scan_sysfs_exit(s
   * efi_pstore_sysfs_entry_iter
   *
   * @record: pstore record to pass to callback
-  * @pos: entry to begin iterating from
   *
   * You MUST call efivar_enter_iter_begin() before this function, and
   * efivar_entry_iter_end() afterwards.
   *
-  * It is possible to begin iteration from an arbitrary entry within
-  * the list by passing @pos. @pos is updated on return to point to
-  * the next entry of the last one passed to efi_pstore_read_func().
-  * To begin iterating from the beginning of the list @pos must be %NULL.
   */
- static int efi_pstore_sysfs_entry_iter(struct pstore_record *record,
-                                      struct efivar_entry **pos)
+ static int efi_pstore_sysfs_entry_iter(struct pstore_record *record)
  {
+       struct efivar_entry **pos = (struct efivar_entry **)&record->psi->data;
        struct efivar_entry *entry, *n;
        struct list_head *head = &efivar_sysfs_list;
        int size = 0;
   */
  static ssize_t efi_pstore_read(struct pstore_record *record)
  {
-       struct efivar_entry *entry = (struct efivar_entry *)record->psi->data;
        ssize_t size;
  
        record->buf = kzalloc(EFIVARS_DATA_SIZE_MAX, GFP_KERNEL);
                size = -EINTR;
                goto out;
        }
-       size = efi_pstore_sysfs_entry_iter(record, &entry);
+       size = efi_pstore_sysfs_entry_iter(record);
        efivar_entry_iter_end();
  
  out:
@@@ -254,7 -248,7 +248,7 @@@ static int efi_pstore_write(struct psto
        for (i = 0; i < DUMP_NAME_LEN; i++)
                efi_name[i] = name[i];
  
 -      efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
 +      ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
                              !pstore_cannot_block_path(record->reason),
                              record->size, record->psi->buf);
  
This page took 0.062447 seconds and 4 git commands to generate.