Skip to contentSkip to conversation

cmd: ufetch: Initialise size before first use

PATCH In review Andrew Goodbody 4 participants 7 messages Jun 26, 2025 – Jul 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: ufetch: Initialise size before first use

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)
---
 cmd/ufetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -1
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
 	const char *model, *compatible;
 	char *ipaddr;
 	int n_cmds, n_cpus = 0, compatlen;
-	size_t size;
+	size_t size = 0;
 	ofnode np;
 	bool skip_ascii = false;
 

---
base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,

Signature · 1 line
Andrew Goodbody <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)
Quoted 23 lines
---
  cmd/ufetch.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -2
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
  	const char *model, *compatible;
  	char *ipaddr;
  	int n_cmds, n_cpus = 0, compatlen;
-	size_t size;
+	size_t size = 0;
  	ofnode np;
  	bool skip_ascii = false;
 
 
---

base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,

Reviewed-by on v1 1/1
#2 lore raw
In reply to Andrew Goodbody
Quoted 9 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)

---

Quoted 25 lines
 cmd/ufetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -2
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
        const char *model, *compatible;
        char *ipaddr;
        int n_cmds, n_cpus = 0, compatlen;
-       size_t size;
+       size_t size = 0;
        ofnode np;
        bool skip_ascii = false;
 
 
---

base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,
--
Andrew Goodbody <[email protected]>

Reviewed-by on v1 1/1
#3 lore raw
In reply to Andrew Goodbody
Quoted 7 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)
Quoted 23 lines
---
  cmd/ufetch.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -2
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
  	const char *model, *compatible;
  	char *ipaddr;
  	int n_cmds, n_cpus = 0, compatlen;
-	size_t size;
+	size_t size = 0;
  	ofnode np;
  	bool skip_ascii = false;
 
 
---

base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,

Signature · 1 line
Casey (she/they)
#4 lore raw
In reply to Andrew Goodbody

ping?

Quoted 30 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)
---
  cmd/ufetch.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -2
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
  	const char *model, *compatible;
  	char *ipaddr;
  	int n_cmds, n_cpus = 0, compatlen;
-	size_t size;
+	size_t size = 0;
  	ofnode np;
  	bool skip_ascii = false;
 
 
---

base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,

#5 lore raw

Hi Andrew,

Sorry I missed the thank you letter for this one. This patch was picked as 8830e72092e0

Kind regards,

Quoted 34 lines · Andrew Goodbody

ping?

Quoted 30 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)

---
  cmd/ufetch.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -1
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int
 flag, int argc,
       const char *model, *compatible;
       char *ipaddr;
       int n_cmds, n_cpus = 0, compatlen;
-    size_t size;
+    size_t size = 0;
       ofnode np;
       bool skip_ascii = false;


---
base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,

Signature · 1 line
// Casey (she/her)
#6 lore raw

Thanks Casey. It is just that this patch still shows as 'New' in patchwork rather than 'Accepted'.

Andrew

Quoted 43 lines · Casey Connolly

Hi Andrew,

Sorry I missed the thank you letter for this one. This patch was picked as 8830e72092e0

Kind regards,

Quoted 34 lines · Andrew Goodbody

ping?

Quoted 30 lines · Andrew Goodbody

The local variable size is not assigned to before it is used for the first time. Correct this.

This issue was found by Smatch.

Fixes 86d462c05d57 (cmd: add a fetch utility)
---
   cmd/ufetch.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ufetch.c +1 -2
index 46bd16824e6..bc5db08eee1 100644
@@ -93,7 +93,7 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int
 flag, int argc,
       const char *model, *compatible;
       char *ipaddr;
       int n_cmds, n_cpus = 0, compatlen;
-    size_t size;
+    size_t size = 0;
       ofnode np;
       bool skip_ascii = false;
 
---

base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56
change-id: 20250626-ufetch_fix-54b741710142

Best regards,