Skip to contentSkip to conversation

xlnx-bbram: hw/nvram: Fix Coverity CID 1487233

PATCH Applied Tong Ho 3 participants 4 messages Apr 1, 2022 – Apr 5, 2022

lore
Share & tools
lore

Tong Ho

author
#0 lore raw

cover xlnx-bbram: hw/nvram: Fix Coverity CID 1487233

This patch addresses Coverity CID 1487233 by adding the required initialiation of a local variable of type Error *.

Tong Ho (1):
xlnx-bbram: hw/nvram: Fix uninitialized Error *

 hw/nvram/xlnx-bbram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/1 xlnx-bbram: hw/nvram: Fix uninitialized Error *

This adds required initialization of Error * variable.

---
 hw/nvram/xlnx-bbram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/nvram/xlnx-bbram.c +1 -1
index b70828e5bf..6ed32adad9 100644
@@ -89,7 +89,7 @@ static bool bbram_pgm_enabled(XlnxBBRam *s)
 
 static void bbram_bdrv_error(XlnxBBRam *s, int rc, gchar *detail)
 {
-    Error *errp;
+    Error *errp = NULL;
 
     error_setg_errno(&errp, -rc, "%s: BBRAM backstore %s failed.",
                      blk_name(s->blk), detail);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] xlnx-bbram: hw/nvram: Fix uninitialized Error *

Quoted 3 lines · Tong Ho

This adds required initialization of Error * variable.

Quoted 21 lines
---
 hw/nvram/xlnx-bbram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/nvram/xlnx-bbram.c +1 -1
index b70828e5bf..6ed32adad9 100644
@@ -89,7 +89,7 @@ static bool bbram_pgm_enabled(XlnxBBRam *s)
 
 static void bbram_bdrv_error(XlnxBBRam *s, int rc, gchar *detail)
 {
-    Error *errp;
+    Error *errp = NULL;
 
     error_setg_errno(&errp, -rc, "%s: BBRAM backstore %s failed.",
                      blk_name(s->blk), detail);
Signature · 1 line
2.25.1
#3 lore raw
In reply to Tong Ho
Quoted 9 lines · Tong Ho

This patch addresses Coverity CID 1487233 by adding the required initialiation of a local variable of type Error *.

Tong Ho (1):
xlnx-bbram: hw/nvram: Fix uninitialized Error *

 hw/nvram/xlnx-bbram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to target-arm.next for 7.0, thanks.

-- PMM