mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
@@ -55,6 +55,7 @@ static void free_pstore_private(struct pstore_private *private)
|
|||||||
return;
|
return;
|
||||||
if (private->record) {
|
if (private->record) {
|
||||||
kfree(private->record->buf);
|
kfree(private->record->buf);
|
||||||
|
kfree(private->record->priv);
|
||||||
kfree(private->record);
|
kfree(private->record);
|
||||||
}
|
}
|
||||||
kfree(private);
|
kfree(private);
|
||||||
|
@@ -769,6 +769,7 @@ void pstore_get_backend_records(struct pstore_info *psi,
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
/* pstore_mkfile() did not take record, so free it. */
|
/* pstore_mkfile() did not take record, so free it. */
|
||||||
kfree(record->buf);
|
kfree(record->buf);
|
||||||
|
kfree(record->priv);
|
||||||
kfree(record);
|
kfree(record);
|
||||||
if (rc != -EEXIST || !quiet)
|
if (rc != -EEXIST || !quiet)
|
||||||
failed++;
|
failed++;
|
||||||
|
@@ -57,6 +57,9 @@ struct pstore_info;
|
|||||||
* @size: size of @buf
|
* @size: size of @buf
|
||||||
* @ecc_notice_size:
|
* @ecc_notice_size:
|
||||||
* ECC information for @buf
|
* ECC information for @buf
|
||||||
|
* @priv: pointer for backend specific use, will be
|
||||||
|
* kfree()d by the pstore core if non-NULL
|
||||||
|
* when the record is freed.
|
||||||
*
|
*
|
||||||
* Valid for PSTORE_TYPE_DMESG @type:
|
* Valid for PSTORE_TYPE_DMESG @type:
|
||||||
*
|
*
|
||||||
@@ -74,6 +77,7 @@ struct pstore_record {
|
|||||||
char *buf;
|
char *buf;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
ssize_t ecc_notice_size;
|
ssize_t ecc_notice_size;
|
||||||
|
void *priv;
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
enum kmsg_dump_reason reason;
|
enum kmsg_dump_reason reason;
|
||||||
|
Reference in New Issue
Block a user