Message ID | 1413874945-16560-1-git-send-email-kraxel@redhat.com |
---|---|
State | Rejected |
Delegated to: | Tom Rini |
Headers | show |
Dear Gerd, In message <1413874945-16560-1-git-send-email-kraxel@redhat.com> you wrote: > base[0] is saved, but never restored. Patches for this have been submitted before, but were rejected. You may want to dig the archives for these. What exactly is your test case where you see any memory corruption? > - if ((val = *addr) != 0) { > + val = *addr; > + *addr = save[i]; > + if ((val = 0) != 0) { --------^^^^^^^^^^^^^^^^^^^^^^ This code looks pretty much wrong to me; the condition "0 != 0" can never become true... NAK. Best regards, Wolfgang Denk
diff --git a/common/memsize.c b/common/memsize.c index 589400d..8bda2ba 100644 --- a/common/memsize.c +++ b/common/memsize.c @@ -48,7 +48,9 @@ long get_ram_size(long *base, long maxsize) *addr = 0; sync (); - if ((val = *addr) != 0) { + val = *addr; + *addr = save[i]; + if ((val = 0) != 0) { /* Restore the original data before leaving the function. */ sync ();
base[0] is saved, but never restored. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- common/memsize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)