From: Wolfgang Denk Date: Tue, 21 Oct 2014 11:27:55 +0200 Subject: [U-Boot] [PATCH] fix get_ram_size memory corruption In-Reply-To: <1413874945-16560-1-git-send-email-kraxel@redhat.com> References: <1413874945-16560-1-git-send-email-kraxel@redhat.com> Message-ID: <20141021092755.BCA3938095D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Presidency: The greased pig in the field game of American politics. - Ambrose Bierce