From fdd0311863b32b42bb2c54e60c987bbbabc0c430 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Sun, 5 Mar 2017 00:56:38 -0800 Subject: 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 --- fs/pstore/pmsg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fs/pstore/pmsg.c') 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; } -- cgit