linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: linux-efi <linux-efi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] efi/fdt: fix panic when no valid fdt found
Date: Fri, 26 Mar 2021 14:57:36 +0100	[thread overview]
Message-ID: <CAMj1kXHxHDEVbUz9L5d6pSMRB6wLFL_GiqA18X6XN4XbnifsXQ@mail.gmail.com> (raw)
In-Reply-To: <20210324145435.19753-1-changbin.du@gmail.com>

On Wed, 24 Mar 2021 at 15:54, Changbin Du <changbin.du@gmail.com> wrote:
>
> setup_arch() would invoke efi_init()->efi_get_fdt_params(). If no
> valid fdt found then initial_boot_params will be null. So we
> should stop further fdt processing here. I encountered this
> issue on risc-v.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>

I'll queue this up, thanks.

> ---
>  drivers/firmware/efi/fdtparams.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/firmware/efi/fdtparams.c b/drivers/firmware/efi/fdtparams.c
> index bb042ab7c2be..e901f8564ca0 100644
> --- a/drivers/firmware/efi/fdtparams.c
> +++ b/drivers/firmware/efi/fdtparams.c
> @@ -98,6 +98,9 @@ u64 __init efi_get_fdt_params(struct efi_memory_map_data *mm)
>         BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(name));
>         BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(dt_params[0].params));
>
> +       if (!fdt)
> +               return 0;
> +
>         for (i = 0; i < ARRAY_SIZE(dt_params); i++) {
>                 node = fdt_path_offset(fdt, dt_params[i].path);
>                 if (node < 0)
> --
> 2.30.2
>

      reply	other threads:[~2021-03-26 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 14:54 [PATCH] efi/fdt: fix panic when no valid fdt found Changbin Du
2021-03-26 13:57 ` Ard Biesheuvel [this message]

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=CAMj1kXHxHDEVbUz9L5d6pSMRB6wLFL_GiqA18X6XN4XbnifsXQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=changbin.du@gmail.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).