lkml.org 
[lkml]   [2016]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 3/7] pstore: Warn for the case of PSTORE_TYPE_PMSG write using deprecated function
On Thu, Oct 20, 2016 at 12:34 AM, Joel Fernandes <joelaf@google.com> wrote:
> PMSG now uses ramoops_pstore_write_buf_user instead of ramoops_pstore_write_buf
> Print a ratelimited warning if the ramoops_pstore_write_buf is called.
>
> Signed-off-by: Joel Fernandes <joelaf@google.com>
> ---
> fs/pstore/ram.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index cb07ef6..9104ae9 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -288,10 +288,8 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type,
> persistent_ram_write(cxt->fprz, buf, size, PSTORE_RAM_LOCK);
> return 0;
> } else if (type == PSTORE_TYPE_PMSG) {
> - if (!cxt->mprz)
> - return -ENOMEM;
> - persistent_ram_write(cxt->mprz, buf, size, PSTORE_RAM_LOCK);
> - return 0;
> + pr_warn_ratelimited("ramoops: warning: PMSG shouldn't call %s\n",
> + __func__);
> }
>
> if (type != PSTORE_TYPE_DMESG)
> --
> 2.7.4
>

Cool, I'll take this into -next too since it's stand-alone.

Thanks!

-Kees

--
Kees Cook
Nexus Security

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