]> git.sur5r.net Git - u-boot/blobdiff - cmd/spi.c
net: Add new wol command - Wake on LAN
[u-boot] / cmd / spi.c
index 64c3ffcf423b35fc1b0a65daccb99d490a053c5f..9a2edcff65cafaaaaaa19ad42d6b3bd1ff563a79 100644 (file)
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2002
  * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -51,6 +50,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)