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

Joel Sherrill joel.sherrill at oarcorp.com
Tue Sep 1 21:40:52 UTC 2015


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

diff --git a/tools/cpu/nios2/memory.c b/tools/cpu/nios2/memory.c
index cd88b8b..9b56d64 100644
--- a/tools/cpu/nios2/memory.c
+++ b/tools/cpu/nios2/memory.c
@@ -20,6 +20,8 @@ memory_desc *find_memory(device_desc *devices)
   struct ptf_item pi;
   memory_desc *tmd, *memory;
 
+  memory = NULL;
+
   /********************************************************/
   /* Check which of the devices are memory, sort by size */
 
@@ -29,8 +31,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");
-- 
1.8.3.1




More information about the devel mailing list