summaryrefslogtreecommitdiffstats
path: root/fs/pstore/pmsg.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-03-05 00:56:38 -0800
committerKees Cook <keescook@chromium.org>2017-03-07 14:01:01 -0800
commitfdd0311863b32b42bb2c54e60c987bbbabc0c430 (patch)
treedb38dec895d060edecc9921db07bf71f961fb860 /fs/pstore/pmsg.c
parentb10b471145f28c219d9ddcc309a67e053776865a (diff)
downloadlinux-fdd0311863b32b42bb2c54e60c987bbbabc0c430.tar.bz2
pstore: Replace arguments for write_buf_user() API
Removes argument list in favor of pstore record, though the user buffer remains passed separately since it must carry the __user annotation. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore/pmsg.c')
-rw-r--r--fs/pstore/pmsg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c
index 78f6176c020f..ce35907602de 100644
--- a/fs/pstore/pmsg.c
+++ b/fs/pstore/pmsg.c
@@ -23,7 +23,11 @@ static DEFINE_MUTEX(pmsg_lock);
static ssize_t write_pmsg(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
- u64 id;
+ struct pstore_record record = {
+ .type = PSTORE_TYPE_PMSG,
+ .size = count,
+ .psi = psinfo,
+ };
int ret;
if (!count)
@@ -34,8 +38,7 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf,
return -EFAULT;
mutex_lock(&pmsg_lock);
- ret = psinfo->write_buf_user(PSTORE_TYPE_PMSG, 0, &id, 0, buf, 0, count,
- psinfo);
+ ret = psinfo->write_buf_user(&record, buf);
mutex_unlock(&pmsg_lock);
return ret ? ret : count;
}