lkml.org 
[lkml]   [2015]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()
Date
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



\
 
 \ /
  Last update: 2015-11-07 06:01    [W:1.493 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site