X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cmd%2Fspi.c;h=f16ef9a5db554077179a3ef5cbac00ce7e773b09;hb=f7160eac83f86a0fc7bd3b4a2b52520ad71e4d2b;hp=64c3ffcf423b35fc1b0a65daccb99d490a053c5f;hpb=d82477748d641e60ba3e1a0b55d98362aed70f80;p=u-boot diff --git a/cmd/spi.c b/cmd/spi.c index 64c3ffcf42..f16ef9a5db 100644 --- a/cmd/spi.c +++ b/cmd/spi.c @@ -51,6 +51,8 @@ static int do_spi_xfer(int bus, int cs) snprintf(name, sizeof(name), "generic_%d:%d", bus, cs); str = strdup(name); + if (!str) + return -ENOMEM; ret = spi_get_bus_and_cs(bus, cs, 1000000, mode, "spi_generic_drv", str, &dev, &slave); if (ret)