Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1264734
| From | Geliang Tang <geliangtang@163.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() |
| Date | 2015-11-07 06:00 +0100 |
| Message-ID | <qs3Lz-608-9@gated-at.bofh.it> (permalink) |
| References | <qs3Lz-608-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
drivers/firmware/efi/efi-pstore.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index eac76a7..62d57d8 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -393,6 +393,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);
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Geliang Tang <geliangtang@163.com> - 2015-11-07 06:00 +0100
Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-11 18:00 +0100
Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Kees Cook <keescook@chromium.org> - 2015-11-12 00:10 +0100
RE: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() "Luck, Tony" <tony.luck@intel.com> - 2015-11-12 00:30 +0100
Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Kees Cook <keescook@chromium.org> - 2015-11-12 00:30 +0100
Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-12 13:30 +0100
csiph-web