Skip to content
Snippets Groups Projects
Commit 218da804 authored by Patrick Delaunay's avatar Patrick Delaunay Committed by Tom Rini
Browse files

common/memsize.c: restore content of the base address


For the last return of function get_ram_size(),
when size=maxsize, restore the base address (*base)
content.

Add comment for the remaining case to avoid regression:
this case is already correctly handled.

Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay@st.com>
parent c5da05cd
No related branches found
No related tags found
No related merge requests found
......@@ -77,9 +77,16 @@ long get_ram_size(long *base, long maxsize)
addr = base + cnt;
*addr = save[--i];
}
/* warning: don't restore save_base in this case,
* it is already done in the loop because
* base and base+size share the same physical memory
* and *base is saved after *(base+size) modification
* in first loop
*/
return (size);
}
}
*base = save_base;
return (maxsize);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment