From: Bin Meng Date: Tue, 26 Sep 2023 08:43:32 +0000 (+0800) Subject: cmd: host: Mandate the filename parameter in the 'bind' command X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=77ca9d74571e92969591d39df134ccd72296f4d9;p=u-boot.git cmd: host: Mandate the filename parameter in the 'bind' command At present the host bind command does not require filename to be provided. When it is not given NULL is passed to the host device driver, which ends up failure afterwards. Change to mandate the filename so that it is useful. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- diff --git a/cmd/host.c b/cmd/host.c index fb1cb1fdd1..b924940ffb 100644 --- a/cmd/host.c +++ b/cmd/host.c @@ -59,10 +59,10 @@ static int do_host_bind(struct cmd_tbl *cmdtp, int flag, int argc, argv++; } - if (argc > 2) + if (argc != 2) return CMD_RET_USAGE; label = argv[0]; - file = argc > 1 ? argv[1] : NULL; + file = argv[1]; ret = host_create_attach_file(label, file, removable, &dev); if (ret) { @@ -253,7 +253,7 @@ U_BOOT_CMD( "host save hostfs - [] - " "save a file to host\n" "host size hostfs - - determine size of file on host\n" - "host bind [-r]