Commit c271bdbf authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pstore-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore updates from Kees Cook:
 "These mostly some minor cleanups and a bug fix for an ftrace corner
  case:

   - Improve failure paths (chenqiwu)

   - Fix ftrace position index (Vasily Averin)

   - Use proper flexible-array member (Gustavo A. R. Silva)"

* tag 'pstore-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/ram: Replace zero-length array with flexible-array member
  pstore: pstore_ftrace_seq_next should increase position index
  pstore/ram: remove unnecessary ramoops_unregister_dummy()
  pstore/platform: fix potential mem leak if pstore_init_fs failed
parents 78b0dedd 8128d3aa
......@@ -87,11 +87,11 @@ static void *pstore_ftrace_seq_next(struct seq_file *s, void *v, loff_t *pos)
struct pstore_private *ps = s->private;
struct pstore_ftrace_seq_data *data = v;
(*pos)++;
data->off += REC_SIZE;
if (data->off + REC_SIZE > ps->total_size)
return NULL;
(*pos)++;
return data;
}
......@@ -101,6 +101,9 @@ static int pstore_ftrace_seq_show(struct seq_file *s, void *v)
struct pstore_ftrace_seq_data *data = v;
struct pstore_ftrace_record *rec;
if (!data)
return 0;
rec = (struct pstore_ftrace_record *)(ps->record->buf + data->off);
seq_printf(s, "CPU:%d ts:%llu %08lx %08lx %ps <- %pS\n",
......
......@@ -823,9 +823,9 @@ static int __init pstore_init(void)
ret = pstore_init_fs();
if (ret)
return ret;
free_buf_for_compression();
return 0;
return ret;
}
late_initcall(pstore_init);
......
......@@ -963,7 +963,6 @@ static void __init ramoops_register_dummy(void)
pr_info("could not create platform device: %ld\n",
PTR_ERR(dummy));
dummy = NULL;
ramoops_unregister_dummy();
}
}
......
......@@ -34,7 +34,7 @@ struct persistent_ram_buffer {
uint32_t sig;
atomic_t start;
atomic_t size;
uint8_t data[0];
uint8_t data[];
};
#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment