diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-06-22 09:31:31 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2022-06-24 20:40:04 +0200 |
commit | 8ca869b24538a7b5501af368e87e4a59b0c04117 (patch) | |
tree | 4ba6d8dfa417849391aaba1681294029c35aa9f0 /fs/pstore | |
parent | f662092b2e0c4a43d09e5b1f67ca969ea47a93d3 (diff) |
pstore: Add priv field to pstore_record for backend specific use
The EFI pstore backend will need to store per-record variable name data
when we switch away from the efivars layer. Add a priv field to struct
pstore_record, and document it as holding a backend specific pointer
that is assumed to be a kmalloc()d buffer, and will be kfree()d when the
entire record is freed.
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/inode.c | 1 | ||||
-rw-r--r-- | fs/pstore/platform.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 14658b009f1b..ffbadb8b3032 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -55,6 +55,7 @@ static void free_pstore_private(struct pstore_private *private) return; if (private->record) { kfree(private->record->buf); + kfree(private->record->priv); kfree(private->record); } kfree(private); diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index e26162f102ff..0c034ea39954 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -769,6 +769,7 @@ void pstore_get_backend_records(struct pstore_info *psi, if (rc) { /* pstore_mkfile() did not take record, so free it. */ kfree(record->buf); + kfree(record->priv); kfree(record); if (rc != -EEXIST || !quiet) failed++; |