Skip to content

Commit c271bdb

Browse files
committed
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
2 parents 78b0ded + 8128d3a commit c271bdb

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

fs/pstore/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ static void *pstore_ftrace_seq_next(struct seq_file *s, void *v, loff_t *pos)
8787
struct pstore_private *ps = s->private;
8888
struct pstore_ftrace_seq_data *data = v;
8989

90+
(*pos)++;
9091
data->off += REC_SIZE;
9192
if (data->off + REC_SIZE > ps->total_size)
9293
return NULL;
9394

94-
(*pos)++;
9595
return data;
9696
}
9797

@@ -101,6 +101,9 @@ static int pstore_ftrace_seq_show(struct seq_file *s, void *v)
101101
struct pstore_ftrace_seq_data *data = v;
102102
struct pstore_ftrace_record *rec;
103103

104+
if (!data)
105+
return 0;
106+
104107
rec = (struct pstore_ftrace_record *)(ps->record->buf + data->off);
105108

106109
seq_printf(s, "CPU:%d ts:%llu %08lx %08lx %ps <- %pS\n",

fs/pstore/platform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,9 @@ static int __init pstore_init(void)
823823

824824
ret = pstore_init_fs();
825825
if (ret)
826-
return ret;
826+
free_buf_for_compression();
827827

828-
return 0;
828+
return ret;
829829
}
830830
late_initcall(pstore_init);
831831

fs/pstore/ram.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,6 @@ static void __init ramoops_register_dummy(void)
963963
pr_info("could not create platform device: %ld\n",
964964
PTR_ERR(dummy));
965965
dummy = NULL;
966-
ramoops_unregister_dummy();
967966
}
968967
}
969968

fs/pstore/ram_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct persistent_ram_buffer {
3434
uint32_t sig;
3535
atomic_t start;
3636
atomic_t size;
37-
uint8_t data[0];
37+
uint8_t data[];
3838
};
3939

4040
#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */

0 commit comments

Comments
 (0)