From a16a09f8693fbbab01714e001d57f1fcc53a1b42 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 25 Mar 2021 02:07:23 +0100 Subject: [PATCH] soc/amd/common/block/i2c: fix control flow bug commit 4f87ae1d4a3a597f1260534001bd99160cc8ca99 introduced a regression in the I2C initialization resulting in soc_i2c_misc_init never getting called, since the continue statement was indented like it belonged to the if above, but due to the missing curly braces it was outside the if block. Signed-off-by: Felix Held Found-by: Coverity CID 1451395, 1451387 Change-Id: Id1f17ad59cba44e96881f5511df303ae90841ab3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51786 Reviewed-by: Karthik Ramasubramanian Reviewed-by: Raul Rangel Reviewed-by: Angel Pons Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/i2c/i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/amd/common/block/i2c/i2c.c b/src/soc/amd/common/block/i2c/i2c.c index 95e25798d2..ec05e49204 100644 --- a/src/soc/amd/common/block/i2c/i2c.c +++ b/src/soc/amd/common/block/i2c/i2c.c @@ -100,9 +100,10 @@ static void dw_i2c_soc_init(bool is_early_init) cfg->early_init != is_early_init) continue; - if (dw_i2c_init(bus, cfg)) + if (dw_i2c_init(bus, cfg)) { printk(BIOS_ERR, "Failed to init i2c bus %d\n", bus); continue; + } soc_i2c_misc_init(bus, cfg); }