Commit cae73167 authored by Geliang Tang's avatar Geliang Tang Committed by Kees Cook

efi-pstore: implement efivars_pstore_exit()

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: default avatarGeliang Tang <geliangtang@163.com>
Acked-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 52d210d9
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment