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>
This commit is contained in:
@@ -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;
|
||||
|
Verwijs in nieuw issue
Block a user