All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] pstore/ram: Make initialization check as first one
       [not found] <5c4e64db.1c69fb81.5f2dc.bfbaSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2019-02-12 20:11 ` Kees Cook
  0 siblings, 0 replies; only message in thread
From: Kees Cook @ 2019-02-12 20:11 UTC (permalink / raw)
  To: Yue Hu; +Cc: Anton Vorontsov, Colin Cross, Tony Luck, LKML

On Sun, Jan 27, 2019 at 6:11 PM Yue Hu <huyue2@yulong.com> wrote:
>
> From 4320c0fcb5d685c8099937abce88e0b7fbbfe8dc Mon Sep 17 00:00:00 2001
> From: Yue Hu <huyue2@yulong.com>
> Date: Wed, 23 Jan 2019 16:56:48 +0800
> Subject: [PATCH] pstore/ram: Make initialization check as first one
>
> Since only one single ramoops area allowed at a time, other probes
> include device tree related are meaningless, it will waste cpu
> consumtion. So let's check it firstly.
>
> Signed-off-by: Yue Hu <huyue2@yulong.com>
> ---
>  fs/pstore/ram.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 1adb5e3..ca01778 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -715,15 +715,6 @@ static int ramoops_probe(struct platform_device *pdev)
>         phys_addr_t paddr;
>         int err = -EINVAL;
>
> -       if (dev_of_node(dev) && !pdata) {
> -               pdata = &pdata_local;
> -               memset(pdata, 0, sizeof(*pdata));
> -
> -               err = ramoops_parse_dt(pdev, pdata);
> -               if (err < 0)
> -                       goto fail_out;
> -       }
> -
>         /*
>          * Only a single ramoops area allowed at a time, so fail extra
>          * probes.
> @@ -733,6 +724,15 @@ static int ramoops_probe(struct platform_device *pdev)
>                 goto fail_out;
>         }
>
> +       if (dev_of_node(dev) && !pdata) {
> +               pdata = &pdata_local;
> +               memset(pdata, 0, sizeof(*pdata));
> +
> +               err = ramoops_parse_dt(pdev, pdata);
> +               if (err < 0)
> +                       goto fail_out;
> +       }
> +
>         /* Make sure we didn't get bogus platform data pointer. */
>         if (!pdata) {
>                 pr_err("NULL platform data\n");
> --
> 1.9.1

Applied, thanks!

-- 
Kees Cook

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-12 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5c4e64db.1c69fb81.5f2dc.bfbaSMTPIN_ADDED_BROKEN@mx.google.com>
2019-02-12 20:11 ` [PATCH] pstore/ram: Make initialization check as first one Kees Cook

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.