diff options
author | Brian Norris <briannorris@chromium.org> | 2017-02-09 07:44:44 +0100 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-02-09 20:49:49 +0100 |
commit | 8672aed7bd865774257efd40929702759a869329 (patch) | |
tree | 7b1fa5d524bd20873e8f5f977e0f4b98c047c4be /fs/pstore | |
parent | Revert "x86/ioapic: Restore IO-APIC irq_chip retrigger callback" (diff) | |
download | linux-8672aed7bd865774257efd40929702759a869329.tar.xz linux-8672aed7bd865774257efd40929702759a869329.zip |
pstore: don't OOPS when there are no ftrace zones
We'll OOPS in ramoops_get_next_prz() if the platform didn't ask for any
ftrace zones (i.e., cxt->fprzs will be NULL). Let's just skip this
entire FTRACE section if there's no 'fprzs'.
Regression seen on a coreboot/depthcharge-based Chromebook.
Fixes: 2fbea82bbb89 ("pstore: Merge per-CPU ftrace records into one")
Cc: Joel Fernandes <joelaf@google.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/ram.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 27c059e1760a..1d887efaaf71 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -280,7 +280,7 @@ static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type, 1, id, type, PSTORE_TYPE_PMSG, 0); /* ftrace is last since it may want to dynamically allocate memory. */ - if (!prz_ok(prz)) { + if (!prz_ok(prz) && cxt->fprzs) { if (!(cxt->flags & RAMOOPS_FLAG_FTRACE_PER_CPU)) { prz = ramoops_get_next_prz(cxt->fprzs, &cxt->ftrace_read_cnt, 1, id, type, |