[scan-admin at coverity.com: New Defects reported by Coverity Scan for Das U-Boot]

Tom Rini trini at konsulko.com
Tue Apr 20 03:17:42 CEST 2021


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: <https://lists.denx.de/pipermail/u-boot/attachments/20210419/8f54f47f/attachment.sig>


More information about the U-Boot mailing list