Skip to content

Commit

Permalink
pstore: Warn on PSTORE_TYPE_PMSG using deprecated function
Browse files Browse the repository at this point in the history
PMSG now uses ramoops_pstore_write_buf_user() instead of ...write_buf().
Print a ratelimited warning if gets accidentally called.

Signed-off-by: Joel Fernandes <joelaf@google.com>
[kees: adjusted commit log and added -EINVAL return]
Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Joel Fernandes authored and Kees Cook committed Nov 11, 2016
1 parent 1097044 commit d8991f5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/pstore/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,8 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type,
persistent_ram_write(cxt->fprz, buf, size);
return 0;
} else if (type == PSTORE_TYPE_PMSG) {
if (!cxt->mprz)
return -ENOMEM;
persistent_ram_write(cxt->mprz, buf, size);
return 0;
pr_warn_ratelimited("PMSG shouldn't call %s\n", __func__);
return -EINVAL;
}

if (type != PSTORE_TYPE_DMESG)
Expand Down

0 comments on commit d8991f5

Please sign in to comment.