summaryrefslogtreecommitdiff
path: root/fs/pstore/pmsg.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-05-20 01:10:31 +0300
committerKees Cook <keescook@chromium.org>2017-05-31 20:13:44 +0300
commite581ca813a40a4ee53c862d8f6303f486c4b4c34 (patch)
tree66ce296957a12b61e9a583d756b6a0120eb9ded8 /fs/pstore/pmsg.c
parentefb74e4bb1abeb5bd4c9296b2adfdc253561bc72 (diff)
downloadlinux-e581ca813a40a4ee53c862d8f6303f486c4b4c34.tar.xz
pstore: Create common record initializer
In preparation for setting timestamps in the pstore core, create a common initializer routine, instead of using static initializers. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore/pmsg.c')
-rw-r--r--fs/pstore/pmsg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c
index 209755e0d7c8..24db02de1787 100644
--- a/fs/pstore/pmsg.c
+++ b/fs/pstore/pmsg.c
@@ -22,16 +22,16 @@ static DEFINE_MUTEX(pmsg_lock);
static ssize_t write_pmsg(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
- struct pstore_record record = {
- .type = PSTORE_TYPE_PMSG,
- .size = count,
- .psi = psinfo,
- };
+ struct pstore_record record;
int ret;
if (!count)
return 0;
+ pstore_record_init(&record, psinfo);
+ record.type = PSTORE_TYPE_PMSG;
+ record.size = count;
+
/* check outside lock, page in any data. write_user also checks */
if (!access_ok(VERIFY_READ, buf, count))
return -EFAULT;