[coreboot] New Defects reported by Coverity Scan for coreboot

Julius Werner jwerner at chromium.org
Tue Apr 28 01:51:50 CEST 2015


> ** CID 1295489:    (OVERRUN)
>
>
> ________________________________________________________________________________________________________
> *** CID 1295489:    (OVERRUN)
> /src/mainboard/google/veyron_jerry/mainboard.c: 77 in configure_codec()
> 71      gpio_output(GPIO(2, B, 1), 1);          /* EMMC_RST_L */
> 72     }
> 73
> 74     static void configure_codec(void)
> 75     {
> 76      write32(&rk3288_grf->iomux_i2c2, IOMUX_I2C2);   /* CODEC I2C */
>>>>     CID 1295489:    (OVERRUN)
>>>>     Overrunning callee's array of size 2 by passing argument "2U" in call to "i2c_init".
> 77      i2c_init(2, 400*KHz);                           /* CODEC I2C */
> 78
> 79      write32(&rk3288_grf->iomux_i2s, IOMUX_I2S);
> 80      write32(&rk3288_grf->iomux_i2sclk, IOMUX_I2SCLK);
> 81
> 82      rk808_configure_ldo(6, 1800);   /* VCC18_CODEC */

Does anybody know what this is talking about? The code in
i2c_init(bus, hz) just does:

  struct rk3288_i2c_regs *regs = i2c_bus[bus];

and further up in that file:

  struct rk3288_i2c_regs *i2c_bus[] = {
        (struct rk3288_i2c_regs *)0xff650000,
        (struct rk3288_i2c_regs *)0xff140000,
        (struct rk3288_i2c_regs *)0xff660000,
        (struct rk3288_i2c_regs *)0xff150000,
        (struct rk3288_i2c_regs *)0xff160000,
        (struct rk3288_i2c_regs *)0xff170000,
  };

so unless I'm really missing something the array size should be 6, not
2, and the call is perfectly fine. Bug in coverity?



More information about the coreboot mailing list