summaryrefslogtreecommitdiff
path: root/fs/pstore/platform.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-03-05 10:12:24 +0300
committerKees Cook <keescook@chromium.org>2017-03-08 01:00:59 +0300
commit83f70f0769ddd8a368cb6346a918102818232962 (patch)
treec5e0f64fc25986538436a165ad70e81f216dbbbc /fs/pstore/platform.c
parent2a2b0acf768cfb2a9cf6c3b42b0e0eb25cbb5814 (diff)
downloadlinux-83f70f0769ddd8a368cb6346a918102818232962.tar.xz
pstore: Do not duplicate record metadata
This switches the inode-private data from carrying duplicate metadata to keeping the record passed in during pstore_mkfile(). Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r--fs/pstore/platform.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 072326625629..aa3d6e572ede 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -852,14 +852,12 @@ void pstore_get_records(int quiet)
decompress_record(record);
rc = pstore_mkfile(record);
if (rc) {
- /* pstore_mkfile() did not take buf, so free it. */
+ /* pstore_mkfile() did not take record, so free it. */
kfree(record->buf);
+ kfree(record);
if (rc != -EEXIST || !quiet)
failed++;
}
-
- /* Reset for next record. */
- kfree(record);
}
if (psi->close)
psi->close(psi);