summaryrefslogtreecommitdiffstats
path: root/fs/pstore/platform.c
diff options
context:
space:
mode:
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);