提交 8bcf12cc 编写于 作者: H Heinrich Schuchardt 提交者: Heiko Schocher

i2c: mvtwsi.c: Avoid NULL dereference

For '#ifndef CONFIG_DM_I2C' twsi_i2c_init() passes NULL as
4th parameter to __twsi_i2c_init().

Identified with cppcheck.
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
上级 9cef983d
......@@ -490,7 +490,8 @@ static void __twsi_i2c_init(struct mvtwsi_registers *twsi, int speed,
/* Reset controller */
twsi_reset(twsi);
/* Set speed */
*actual_speed = __twsi_i2c_set_bus_speed(twsi, speed);
if (actual_speed)
*actual_speed = __twsi_i2c_set_bus_speed(twsi, speed);
/* Set slave address; even though we don't use it */
writel(slaveadd, &twsi->slave_address);
writel(0, &twsi->xtnd_slave_addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册