Skip to content

Commit

Permalink
efi-pstore: implement efivars_pstore_exit()
Browse files Browse the repository at this point in the history
The original efivars_pstore_exit() is empty. I
 1) add a bufsize check statement.
 2) call pstore_unregister as it is defined now.
 3) free the memory and set bufsize to 0.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Geliang Tang authored and Kees Cook committed Jun 2, 2016
1 parent 52d210d commit cae7316
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/firmware/efi/efi-pstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ static __init int efivars_pstore_init(void)

static __exit void efivars_pstore_exit(void)
{
if (!efi_pstore_info.bufsize)
return;

pstore_unregister(&efi_pstore_info);
kfree(efi_pstore_info.buf);
efi_pstore_info.buf = NULL;
efi_pstore_info.bufsize = 0;
}

module_init(efivars_pstore_init);
Expand Down

0 comments on commit cae7316

Please sign in to comment.