summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-06-01 11:23:23 -0400
committerTom Rini <[email protected]>2023-06-01 11:23:23 -0400
commitf415495e2a261cab52cb03c46a92b7b457728380 (patch)
treeeecf08dd3376548353ec92e67c4ad56215c95fe4 /cmd
parente863c7b2854bf9a882939f828023508fb1a1bc16 (diff)
parent229d689e3c32164875667da282e496b858dbc608 (diff)
Merge branch '2023-05-31-assorted-fixes-and-improvements' into next
- Makefile logic fixes, address some issues that clang uncovers on ARM, assorted code cleanups
Diffstat (limited to 'cmd')
-rw-r--r--cmd/fdt.c2
-rw-r--r--cmd/fs.c2
-rw-r--r--cmd/legacy-mtd-utils.c5
-rw-r--r--cmd/sf.c5
-rw-r--r--cmd/version.c2
5 files changed, 14 insertions, 2 deletions
diff --git a/cmd/fdt.c b/cmd/fdt.c
index aae3278526c..2401ea8b44c 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -733,7 +733,7 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
gd->fdt_blob = blob;
cfg_noffset = fit_conf_get_node(working_fdt, NULL);
- if (!cfg_noffset) {
+ if (cfg_noffset < 0) {
printf("Could not find configuration node: %s\n",
fdt_strerror(cfg_noffset));
return CMD_RET_FAILURE;
diff --git a/cmd/fs.c b/cmd/fs.c
index 5ad11647c2d..6044f73af5b 100644
--- a/cmd/fs.c
+++ b/cmd/fs.c
@@ -20,7 +20,7 @@ U_BOOT_CMD(
"determine a file's size",
"<interface> <dev[:part]> <filename>\n"
" - Find file 'filename' from 'dev' on 'interface'\n"
- " and determine its size."
+ " determine its size, and store in the 'filesize' variable."
);
static int do_load_wrapper(struct cmd_tbl *cmdtp, int flag, int argc,
diff --git a/cmd/legacy-mtd-utils.c b/cmd/legacy-mtd-utils.c
index ac7139f84d6..5903a90fe53 100644
--- a/cmd/legacy-mtd-utils.c
+++ b/cmd/legacy-mtd-utils.c
@@ -88,6 +88,11 @@ int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
return -1;
}
+ if (*size == 0) {
+ debug("ERROR: Invalid size 0\n");
+ return -1;
+ }
+
print:
printf("device %d ", *idx);
if (*size == chipsize)
diff --git a/cmd/sf.c b/cmd/sf.c
index 11b9c25896a..55bef2f7699 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -353,6 +353,11 @@ static int do_spi_flash_erase(int argc, char *const argv[])
if (ret != 1)
return CMD_RET_USAGE;
+ if (size == 0) {
+ debug("ERROR: Invalid size 0\n");
+ return CMD_RET_FAILURE;
+ }
+
/* Consistency checking */
if (offset + size > flash->size) {
printf("ERROR: attempting %s past flash size (%#x)\n",
diff --git a/cmd/version.c b/cmd/version.c
index 190ef6a9061..87e1fa4159c 100644
--- a/cmd/version.c
+++ b/cmd/version.c
@@ -19,6 +19,8 @@
U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
const char version_string[] = U_BOOT_VERSION_STRING;
+const unsigned short version_num = U_BOOT_VERSION_NUM;
+const unsigned char version_num_patch = U_BOOT_VERSION_NUM_PATCH;
static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])