[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/11] aspeed: use first FMC flash as a boot
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-devel] [PATCH v2 10/11] aspeed: use first FMC flash as a boot ROM |
Date: |
Mon, 30 Jan 2017 14:38:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
>> +#define FIRMWARE_ADDR 0x0
>> +
>> +static void write_boot_rom(DriveInfo *dinfo, hwaddr addr, size_t rom_size,
>> + Error **errp)
>> +{
>> + BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
>> + uint8_t *storage;
>> +
>> + if (rom_size > blk_getlength(blk)) {
>> + rom_size = blk_getlength(blk);
>> + }
>> +
>> + storage = g_new0(uint8_t, rom_size);
>
> Hi -- coverity points out that you're not checking for the
> case where blk_getlength() returns negative. (This can happen
> for the case where the BlockBackend represents an insertable
> device like a floppy or cdrom with no medium present.)
>
> Since for aspeed this dinfo always represents a flash device,
> we know this shouldn't happen, so you can just make it a fatal
> error if blk_getlength() doesn't return what you're expecting.
OK. I will send a fix to improve this routine.
Thanks,
C.
- Re: [Qemu-devel] [PATCH v2 08/11] aspeed/smc: reset flash after each test, (continued)
[Qemu-devel] [PATCH v2 09/11] aspeed/smc: extend tests for Command mode, Cédric Le Goater, 2017/01/09
[Qemu-devel] [PATCH v2 10/11] aspeed: use first FMC flash as a boot ROM, Cédric Le Goater, 2017/01/09
[Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, Cédric Le Goater, 2017/01/09
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, mar.krzeminski, 2017/01/11
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, Cédric Le Goater, 2017/01/11
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, mar.krzeminski, 2017/01/14
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, Cédric Le Goater, 2017/01/16
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, mar.krzeminski, 2017/01/16
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, Cédric Le Goater, 2017/01/17
- Re: [Qemu-devel] [PATCH v2 11/11] aspeed/smc: handle dummy bytes when doing fast reads in command mode, mar.krzeminski, 2017/01/17
Re: [Qemu-devel] [PATCH v2 00/11] Aspeed SMC controller fixes and improvements, Peter Maydell, 2017/01/16