From: Geliang Tang <geliangtang@163.com> To: Matt Fleming <matt@codeblueprint.co.uk>, Anton Vorontsov <anton@enomsg.org>, Colin Cross <ccross@android.com>, Kees Cook <keescook@chromium.org>, Tony Luck <tony.luck@intel.com> Cc: Geliang Tang <geliangtang@163.com>, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] efi-pstore: implement efivars_pstore_exit() Date: Fri, 23 Oct 2015 22:56:23 +0800 [thread overview] Message-ID: <ac2cff56766dcd044563b5cc090198f0c50ec217.1445611895.git.geliangtang@163.com> (raw) In-Reply-To: <ab909fa2d2e97904b4cf34df79998548a153dd9c.1445611895.git.geliangtang@163.com> In-Reply-To: <ab909fa2d2e97904b4cf34df79998548a153dd9c.1445611895.git.geliangtang@163.com> 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 c8d794c..453ac19 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
WARNING: multiple messages have this Message-ID (diff)
From: Geliang Tang <geliangtang-9Onoh4P/yGk@public.gmane.org> To: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>, Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>, Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>, Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>, Tony Luck <tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Cc: Geliang Tang <geliangtang-9Onoh4P/yGk@public.gmane.org>, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH 2/2] efi-pstore: implement efivars_pstore_exit() Date: Fri, 23 Oct 2015 22:56:23 +0800 [thread overview] Message-ID: <ac2cff56766dcd044563b5cc090198f0c50ec217.1445611895.git.geliangtang@163.com> (raw) In-Reply-To: <ab909fa2d2e97904b4cf34df79998548a153dd9c.1445611895.git.geliangtang-9Onoh4P/yGk@public.gmane.org> In-Reply-To: <ab909fa2d2e97904b4cf34df79998548a153dd9c.1445611895.git.geliangtang-9Onoh4P/yGk@public.gmane.org> 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-9Onoh4P/yGk@public.gmane.org> --- 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 c8d794c..453ac19 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
next prev parent reply other threads:[~2015-10-23 15:05 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-10-23 14:56 [PATCH 1/2] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Geliang Tang 2015-10-23 14:56 ` Geliang Tang [this message] 2015-10-23 14:56 ` [PATCH 2/2] efi-pstore: implement efivars_pstore_exit() Geliang Tang 2015-10-23 16:54 ` [PATCH 1/2] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Kees Cook 2015-10-25 2:22 ` Geliang Tang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ac2cff56766dcd044563b5cc090198f0c50ec217.1445611895.git.geliangtang@163.com \ --to=geliangtang@163.com \ --cc=anton@enomsg.org \ --cc=ccross@android.com \ --cc=keescook@chromium.org \ --cc=linux-efi@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=matt@codeblueprint.co.uk \ --cc=tony.luck@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.