]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - cmd/spi.c
cmd: pmic: use base 16 for command arguments
[karo-tx-uboot.git] / cmd / spi.c
index 64c3ffcf423b35fc1b0a65daccb99d490a053c5f..f16ef9a5db554077179a3ef5cbac00ce7e773b09 100644 (file)
--- 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)