1
0
Fork 0

pstore: Warn on PSTORE_TYPE_PMSG using deprecated function

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>
zero-colors
Joel Fernandes 2016-10-20 00:34:02 -07:00 committed by Kees Cook
parent 109704492e
commit d8991f51e5
1 changed files with 2 additions and 4 deletions

View File

@ -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)