[PATCH v2 2/5] tools/cpu/nios2/memory.c: Fix uninitialized use of variable memory

Martin Galvan martin.galvan at tallertechnologies.com
Wed Sep 2 21:54:22 UTC 2015


Updates #2405.
---
 tools/cpu/nios2/memory.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/cpu/nios2/memory.c b/tools/cpu/nios2/memory.c
index cd88b8b..cb1ea7f 100644
--- a/tools/cpu/nios2/memory.c
+++ b/tools/cpu/nios2/memory.c
@@ -18,7 +18,8 @@ memory_desc *find_memory(device_desc *devices)
 {
   struct ptf *p;
   struct ptf_item pi;
-  memory_desc *tmd, *memory;
+  memory_desc *tmd;
+  memory_desc *memory = NULL;
 
   /********************************************************/
   /* Check which of the devices are memory, sort by size */
@@ -29,8 +30,6 @@ memory_desc *find_memory(device_desc *devices)
     struct ptf_item pi;
     device_desc *dd;
 
-    memory = NULL;
-
     for(dd = devices; dd; dd=dd->next)
     {
       p = ptf_find(dd->ptf->sub, &pi, item, "Is_Memory_Device", "1");
-- 
2.5.1




More information about the devel mailing list