From: Andrew Goodbody Date: Mon, 28 Jul 2025 15:04:43 +0000 (+0100) Subject: i2c: rcar_iic: Do not use unitialised variable X-Git-Tag: v2025.10-rc2~13^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78b2d408fbf02bcfbf11a5aef2c0c77901854179;p=thirdparty%2Fu-boot.git i2c: rcar_iic: Do not use unitialised variable In rcar_iic_xfer if nmsgs == 0 the ret will not be assigned to. As ret will always be 0 if the for loop is entered, may as well just return 0. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Reviewed-by: Heiko Schocher Reviewed-by: Marek Vasut --- diff --git a/drivers/i2c/rcar_iic.c b/drivers/i2c/rcar_iic.c index e019d06be41..42d575e29ba 100644 --- a/drivers/i2c/rcar_iic.c +++ b/drivers/i2c/rcar_iic.c @@ -191,7 +191,7 @@ static int rcar_iic_xfer(struct udevice *dev, struct i2c_msg *msg, int nmsgs) return -EREMOTEIO; } - return ret; + return 0; } static int rcar_iic_set_speed(struct udevice *dev, uint speed)