Hi,
Please find the latest report on new defect(s) introduced to coreboot found with Coverity Scan.
2 new defect(s) introduced to coreboot found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s)
** CID 1518657: (OVERRUN)
________________________________________________________________________________________________________ *** CID 1518657: (OVERRUN) /src/soc/mediatek/common/i2c.c: 514 in mtk_i2c_speed_init() 508 for (clk_div = 1; clk_div <= max_clk_div; clk_div++) { 509 clk_src = I2C_CLK_HZ / clk_div; 510 bus_ctrl->ac_timing.inter_clk_div = clk_div - 1; 511 512 if (speed > I2C_SPEED_FAST_PLUS) { 513 /* Set master code speed register */
CID 1518657: (OVERRUN) Overrunning callee's array of size 7 by passing argument "bus" (which evaluates to 7) in call to "mtk_i2c_calculate_speed".
514 if (mtk_i2c_calculate_speed(bus, clk_src, I2C_SPEED_FAST, 515 &l_step_cnt, &l_sample_cnt)) 516 continue; 517 518 /* Set the high speed mode register */ 519 if (mtk_i2c_calculate_speed(bus, clk_src, speed, /src/soc/mediatek/common/i2c.c: 525 in mtk_i2c_speed_init() 519 if (mtk_i2c_calculate_speed(bus, clk_src, speed, 520 &step_cnt, &sample_cnt)) 521 continue; 522 523 bus_ctrl->ac_timing.inter_clk_div = (clk_div - 1) << 8 | (clk_div - 1); 524 } else {
CID 1518657: (OVERRUN) Overrunning callee's array of size 7 by passing argument "bus" (which evaluates to 7) in call to "mtk_i2c_calculate_speed".
525 if (mtk_i2c_calculate_speed(bus, clk_src, speed, 526 &l_step_cnt, &l_sample_cnt)) 527 continue; 528 529 /* Disable the high speed transaction */ 530 bus_ctrl->ac_timing.hs = I2C_TIME_CLR_VALUE;
** CID 1518656: Memory - corruptions (OVERRUN) /src/soc/mediatek/common/i2c.c: 510 in mtk_i2c_speed_init()
________________________________________________________________________________________________________ *** CID 1518656: Memory - corruptions (OVERRUN) /src/soc/mediatek/common/i2c.c: 510 in mtk_i2c_speed_init() 504 } 505 506 bus_ctrl = &mtk_i2c_bus_controller[bus]; 507 508 for (clk_div = 1; clk_div <= max_clk_div; clk_div++) { 509 clk_src = I2C_CLK_HZ / clk_div;
CID 1518656: Memory - corruptions (OVERRUN) Overrunning array of 280 bytes at byte offset 280 by dereferencing pointer "bus_ctrl".
510 bus_ctrl->ac_timing.inter_clk_div = clk_div - 1; 511 512 if (speed > I2C_SPEED_FAST_PLUS) { 513 /* Set master code speed register */ 514 if (mtk_i2c_calculate_speed(bus, clk_src, I2C_SPEED_FAST, 515 &l_step_cnt, &l_sample_cnt))
________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0...