[rtems commit] tools/cpu/nios2/memory.c: Fix uninitialized use of variable memory

Joel Sherril joel at rtems.org
Thu Sep 3 16:27:54 UTC 2015


Module:    rtems
Branch:    4.11
Commit:    1491f6948ee0919975f568ee050c2587047240de
Changeset: http://git.rtems.org/rtems/commit/?id=1491f6948ee0919975f568ee050c2587047240de

Author:    Martin Galvan <martin.galvan at tallertechnologies.com>
Date:      Wed Sep  2 16:54:22 2015 -0500

tools/cpu/nios2/memory.c: Fix uninitialized use of variable memory

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");




More information about the vc mailing list