From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Geliang Tang <geliangtang-9Onoh4P/yGk@public.gmane.org>
Cc: 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>,
linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()
Date: Wed, 11 Nov 2015 16:59:47 +0000 [thread overview]
Message-ID: <20151111165947.GD4889@codeblueprint.co.uk> (raw)
In-Reply-To: <c203e0cfee351d6f97c6a1a42c3e25b4be339f93.1446869434.git.geliangtang-9Onoh4P/yGk@public.gmane.org>
On Sat, 07 Nov, at 12:43:48PM, Geliang Tang wrote:
> 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 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);
Looks OK to me. Kees, are you picking this up?
WARNING: multiple messages have this Message-ID (diff)
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Geliang Tang <geliangtang@163.com>
Cc: Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>,
Kees Cook <keescook@chromium.org>,
Tony Luck <tony.luck@intel.com>,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()
Date: Wed, 11 Nov 2015 16:59:47 +0000 [thread overview]
Message-ID: <20151111165947.GD4889@codeblueprint.co.uk> (raw)
In-Reply-To: <c203e0cfee351d6f97c6a1a42c3e25b4be339f93.1446869434.git.geliangtang@163.com>
On Sat, 07 Nov, at 12:43:48PM, Geliang Tang wrote:
> 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);
Looks OK to me. Kees, are you picking this up?
next prev parent reply other threads:[~2015-11-11 16:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-07 4:43 [PATCH v2 0/3] pstore: resend three patches Geliang Tang
2015-11-07 4:43 ` Geliang Tang
2015-11-07 4:43 ` [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Geliang Tang
2015-11-07 4:43 ` [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Geliang Tang
2015-11-07 4:43 ` [PATCH v2 3/3] pstore: drop file opened reference count Geliang Tang
[not found] ` <c203e0cfee351d6f97c6a1a42c3e25b4be339f93.1446869434.git.geliangtang-9Onoh4P/yGk@public.gmane.org>
2015-11-11 16:59 ` Matt Fleming [this message]
2015-11-11 16:59 ` [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming
2015-11-11 23:08 ` Kees Cook
[not found] ` <CAGXu5j+DADxC6LrHMSAnw5N2GRFbby6-iPTgkKC=BZotBqt-NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-11 23:23 ` Luck, Tony
2015-11-11 23:23 ` Luck, Tony
[not found] ` <3908561D78D1C84285E8C5FCA982C28F32B86A52-8oqHQFITsIE64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-11-11 23:24 ` Kees Cook
2015-11-11 23:24 ` Kees Cook
[not found] ` <CAGXu5j+PZwpcRTNFpTYzw-Fs6OJLdvaNDGq=vsW7iEhWunc+8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-02 7:26 ` Geliang Tang, Kees Cook
2016-06-02 7:26 ` Geliang Tang, Kees Cook
2016-06-02 18:26 ` Kees Cook
2016-06-02 18:26 ` Kees Cook
2015-11-12 12:22 ` Matt Fleming
2016-06-02 18:17 ` [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Kees Cook
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=20151111165947.GD4889@codeblueprint.co.uk \
--to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
--cc=anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org \
--cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
--cc=geliangtang-9Onoh4P/yGk@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/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: link
Be 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.