From 17f71fc7802c6c51679f17e76163285f31186b28 Mon Sep 17 00:00:00 2001 From: Martin Galvan Date: Wed, 2 Sep 2015 16:54:22 -0500 Subject: 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(-) (limited to 'tools') diff --git a/tools/cpu/nios2/memory.c b/tools/cpu/nios2/memory.c index cd88b8b7cf..cb1ea7f31e 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"); -- cgit v1.2.3