public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target
@ 2024-09-26 15:13 Qianqiang Liu
  2024-09-27 10:32 ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Qianqiang Liu @ 2024-09-26 15:13 UTC (permalink / raw)
  To: andi.shyti; +Cc: shyam-sundar.s-k, linux-i2c, linux-kernel, Qianqiang Liu

The len variable is not initialized, which may cause the for loop to
behave unexpectedly.

Signed-off-by: Qianqiang Liu <qianqiang.liu@163.com>
---
 drivers/i2c/busses/i2c-amd-asf-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c
index 47e0c90341aed..ba47df5370c72 100644
--- a/drivers/i2c/busses/i2c-amd-asf-plat.c
+++ b/drivers/i2c/busses/i2c-amd-asf-plat.c
@@ -61,7 +61,7 @@ static void amd_asf_process_target(struct work_struct *work)
 	unsigned short piix4_smba = dev->port_addr->start;
 	u8 data[ASF_BLOCK_MAX_BYTES];
 	u8 bank, reg, cmd;
-	u8 len, idx, val;
+	u8 len = 0, idx, val;
 
 	/* Read target status register */
 	reg = inb_p(ASFSLVSTA);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-01 13:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26 15:13 [PATCH] i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target Qianqiang Liu
2024-09-27 10:32 ` Dan Carpenter
2024-09-27 13:34   ` [PATCH v2] " Qianqiang Liu
2024-09-27 13:37     ` Dan Carpenter
2024-09-30  4:33     ` Shyam Sundar S K
2024-10-01  5:57       ` Qianqiang Liu
2024-10-01 13:25     ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox