From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 19 Apr 2021 21:17:42 -0400 Subject: [scan-admin@coverity.com: New Defects reported by Coverity Scan for Das U-Boot] In-Reply-To: <20210420005828.dbdwrxxpjkduytms@talia.n4wrvuuuhszuhem3na2pm5saea.px.internal.cloudapp.net> References: <20210419122046.GX1310@bill-the-cat> <20210420005828.dbdwrxxpjkduytms@talia.n4wrvuuuhszuhem3na2pm5saea.px.internal.cloudapp.net> Message-ID: <20210420011742.GI1310@bill-the-cat> 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, Apr 20, 2021 at 12:58:28AM +0000, Asherah Connor wrote: > Looking at cmd/qfw.c as I touched it last: > > On 21/04/19 08:04:p, Tom Rini wrote: > > ** CID 331156: Incorrect expression (UNUSED_VALUE) > > /cmd/qfw.c: 40 in qemu_fwcfg_cmd_setup_kernel() > > > > > > ________________________________________________________________________________________________________ > > *** CID 331156: Incorrect expression (UNUSED_VALUE) > > /cmd/qfw.c: 40 in qemu_fwcfg_cmd_setup_kernel() > > 34 qfw_read_entry(qfw_dev, FW_CFG_SETUP_DATA, > > 35 le32_to_cpu(setup_size), data_addr); > > 36 data_addr += le32_to_cpu(setup_size); > > 37 > > 38 qfw_read_entry(qfw_dev, FW_CFG_KERNEL_DATA, > > 39 le32_to_cpu(kernel_size), data_addr); > > >>> CID 331156: Incorrect expression (UNUSED_VALUE) > > >>> Assigning value from "(__u32)(__le32)kernel_size" to "data_addr" here, but that stored value is overwritten before it can be used. > > 40 data_addr += le32_to_cpu(kernel_size); > > 41 > > 42 data_addr = initrd_addr; > > 43 qfw_read_entry(qfw_dev, FW_CFG_INITRD_SIZE, 4, &initrd_size); > > 44 if (initrd_size == 0) { > > 45 printf("warning: no initrd available\n"); > > This is unchanged since 2016 and I think is fine to leave as-is. The > data_addr increment goes together with the qfw_read_entry() to keep > advancing the data_addr pointer correctly. > > It does get immediately thrown away in this case, but if we moved any > part of this around or changed it we'd want to keep it, so the warning > is likely best ignored. Thanks, I'll mark it as intentional in the dashboard. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: