summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2016-10-20 00:34:02 -0700
committerKees Cook <keescook@chromium.org>2016-11-11 10:36:46 -0800
commitd8991f51e55fd3c5b8ad055653a5998e53d4ec91 (patch)
tree9588f96b17e7584833161aefd1025e7f8f40930f /fs/pstore
parent109704492ef637956265ec2eb72ae7b3b39eb6f4 (diff)
downloadlinux-d8991f51e55fd3c5b8ad055653a5998e53d4ec91.tar.gz
linux-d8991f51e55fd3c5b8ad055653a5998e53d4ec91.tar.bz2
linux-d8991f51e55fd3c5b8ad055653a5998e53d4ec91.zip
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>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 6ad831b9d1b8..6d1393965b0a 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -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)