[PATCH v3 07/32] bootm: Simplify arguments for bootm_pre_load()

Simon Glass sjg at chromium.org
Tue Nov 21 03:16:11 CET 2023


Hi Ilias,

On Mon, 20 Nov 2023 at 14:02, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Hi Simon,
>
> On Sat, 18 Nov 2023 at 23:06, Simon Glass <sjg at chromium.org> wrote:
> >
> > Move the argument decoding to the caller, to avoid needing to pass the
> > command-line arguments.
> >
> > Add a function comment while we are here.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > Reviewed-by: Tom Rini <trini at konsulko.com>
> > ---
> >
> > (no changes since v1)
>
> [...]
>
> >
> >         if (IS_ENABLED(CONFIG_CMD_BOOTM_PRE_LOAD))
> > @@ -785,7 +794,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
> >                 ret = bootm_start();
> >
> >         if (!ret && (states & BOOTM_STATE_PRE_LOAD))
> > -               ret = bootm_pre_load(cmdtp, flag, argc, argv);
> > +               ret = bootm_pre_load(argv[0]);
>
> Is there a check for the validity of argv[0] before this call?

It is always valid since argv is NULL-terminated. So at worst, arg[0] is NULL.

>
> Thanks
> /Ilias
> >
> >         if (!ret && (states & BOOTM_STATE_FINDOS))
> >                 ret = bootm_find_os(cmdtp, flag, argc, argv);
> > --
> > 2.43.0.rc0.421.g78406f8d94-goog
> >

Regards,
Simon


More information about the U-Boot mailing list