[PATCH] cmd: sf: Fix sf probe crash

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Mon Mar 4 16:45:29 CET 2024


Hi

On Mon, Mar 4, 2024 at 4:44 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 04.03.24 15:47, Weizhao Ouyang wrote:
> > Gentle ping. Not merged yet.
> >
> > BR,
> > Weizhao
>
> Hello Dario,
>
> that patch is in your patchwork review queue. Could you, please, have a
> look.

He is with me, I will ping about all the patches that we need to queue

Michael

>
> Best regards
>
> Heinrich
>
> >
> > On Thu, Jan 4, 2024 at 7:46 PM Weizhao Ouyang <o451686892 at gmail.com> wrote:
> >>
> >> Handle the return value of spi_flash_probe_bus_cs() to avoid sf probe
> >> crashes.
> >>
> >> Signed-off-by: Weizhao Ouyang <o451686892 at gmail.com>
> >> ---
> >>   cmd/sf.c | 5 +++--
> >>   1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/cmd/sf.c b/cmd/sf.c
> >> index 730996c02b..e3866899f6 100644
> >> --- a/cmd/sf.c
> >> +++ b/cmd/sf.c
> >> @@ -135,8 +135,9 @@ static int do_spi_flash_probe(int argc, char *const argv[])
> >>          }
> >>          flash = NULL;
> >>          if (use_dt) {
> >> -               spi_flash_probe_bus_cs(bus, cs, &new);
> >> -               flash = dev_get_uclass_priv(new);
> >> +               ret = spi_flash_probe_bus_cs(bus, cs, &new);
> >> +               if (!ret)
> >> +                       flash = dev_get_uclass_priv(new);
> >>          } else {
> >>                  flash = spi_flash_probe(bus, cs, speed, mode);
> >>          }
> >> --
> >> 2.39.2
> >>
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list