]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_pxe.c
api: net: fix length check in eth_receive()
[karo-tx-uboot.git] / common / cmd_pxe.c
index 2b1115d7276d801d1b49454a745488847be87c03..6b31deab5bea493000996ceb057eff336fde3b20 100644 (file)
@@ -26,7 +26,6 @@
 
 #define MAX_TFTP_PATH_LEN 127
 
-
 /*
  * Like getenv, but prints an error if envvar isn't defined in the
  * environment.  It always returns what getenv does, so it can be used in
@@ -175,8 +174,6 @@ static int do_get_fat(char *file_path, char *file_addr)
        return -ENOENT;
 }
 
-
-
 /*
  * As in pxelinux, paths to files referenced from files we retrieve are
  * relative to the location of bootfile. get_relfile takes such a path and
@@ -365,7 +362,6 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (argc != 1)
                return CMD_RET_USAGE;
 
-
        pxefile_addr_str = from_env("pxefile_addr_r");
 
        if (!pxefile_addr_str)
@@ -558,33 +554,19 @@ static void label_print(void *data)
  */
 static int label_localboot(struct pxe_label *label)
 {
-       char *localcmd, *dupcmd;
-       int ret;
+       char *localcmd;
 
        localcmd = from_env("localcmd");
 
        if (!localcmd)
                return -ENOENT;
 
-       /*
-        * dup the command to avoid any issues with the version of it existing
-        * in the environment changing during the execution of the command.
-        */
-       dupcmd = strdup(localcmd);
-
-       if (!dupcmd)
-               return -ENOMEM;
-
        if (label->append)
                setenv("bootargs", label->append);
 
-       printf("running: %s\n", dupcmd);
+       debug("running: %s\n", localcmd);
 
-       ret = run_command(dupcmd, 0);
-
-       free(dupcmd);
-
-       return ret;
+       return run_command_list(localcmd, strlen(localcmd), 0);
 }
 
 /*