Skip to contentSkip to conversation

optee: Replace uninitialized return variable by proper one.

PATCH New Christoph Müllner 3 participants 3 messages Jan 26, 2020 – Jan 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 optee: Replace uninitialized return variable by proper one.

As hinted by GCC 9, there is a return statement that returns an uninitialized variable in optee_copy_firmware_node(). This patch addresses this.

---

 lib/optee/optee.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/optee/optee.c +1 -1
index 9b49eb8ee7..d4355c6d03 100644
@@ -92,7 +92,7 @@ static int optee_copy_firmware_node(const void *old_blob, void *fdt_blob)
 
 	offs = fdt_add_subnode(fdt_blob, offs, "optee");
 	if (offs < 0)
-		return ret;
+		return offs;
 
 	/* copy the compatible property */
 	prop = fdt_getprop(old_blob, old_offs, "compatible", &len);
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 optee: Replace uninitialized return variable by proper one.

Am Sonntag, 26. Januar 2020, 23:20:54 CET schrieb Christoph Müllner:

Quoted 5 lines

As hinted by GCC 9, there is a return statement that returns an uninitialized variable in optee_copy_firmware_node(). This patch addresses this.

Thanks for catching this mistake of mine

Quoted 20 lines

---

 lib/optee/optee.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/optee/optee.c +1 -1
index 9b49eb8ee7..d4355c6d03 100644
@@ -92,7 +92,7 @@ static int optee_copy_firmware_node(const void *old_blob, void *fdt_blob)
 
 	offs = fdt_add_subnode(fdt_blob, offs, "optee");
 	if (offs < 0)
-		return ret;
+		return offs;
 
 	/* copy the compatible property */
 	prop = fdt_getprop(old_blob, old_offs, "compatible", &len);
#2 lore raw

PATCH 1/1 optee: Replace uninitialized return variable by proper one.

In reply to Christoph Müllner
Quoted 6 lines · Christoph Müllner

As hinted by GCC 9, there is a return statement that returns an uninitialized variable in optee_copy_firmware_node(). This patch addresses this.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200130/7169af9b/attachment.sig>