From: Tom Rini Date: Tue, 8 May 2018 21:31:37 -0400 Subject: [U-Boot] bootm.c: Correct the flush_len used in bootm_load_os() In-Reply-To: <1525192357-6531-1-git-send-email-trini@konsulko.com> References: <1525192357-6531-1-git-send-email-trini@konsulko.com> Message-ID: <20180509013137.GB12235@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, May 01, 2018 at 12:32:37PM -0400, Tom Rini wrote: > In do_bootm_states when doing BOOTM_STATE_LOADOS we use load_end > uninitialized and Coverity notes this now. This however leads down > another interesting path. We pass this pointer to bootm_load_os and > that in turn uses this uninitialized value immediately to calculate the > flush length, and is wrong. We do not know what load_end will be until > after bootm_decomp_image is called, so we must only set flush_len after > that. All of this also makes it clear that the only reason we pass a > pointer for load_end to bootm_load_os is so that we can call lmb_reserve > on success. Rather than initialize load_end to 0 in do_bootm_states we > can just call lmb_reserve ourself. > > Reported-by: Coverity (CID: 175572) > Cc: Simon Glass > Signed-off-by: Tom Rini > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: