summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index b3045530dd4e..4c5cd9368460 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -849,8 +849,10 @@ void pstore_get_backend_records(struct pstore_info *psi,
record->size = psi->read(record);
/* No more records left in backend? */
- if (record->size <= 0)
+ if (record->size <= 0) {
+ kfree(record);
break;
+ }
decompress_record(record);
rc = pstore_mkfile(root, record);