diff options
author | Qianqiang Liu <qianqiang.liu@163.com> | 2024-09-27 21:34:44 +0800 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-11-17 11:57:29 +0100 |
commit | a5089cd23b10c5c861bf5834170c75f9b4c36e08 (patch) | |
tree | 5b34755a4244ef64449a52d7de462ad5d5c636cc | |
parent | 63ae99f7e66ebdc483bc0cf029b46cb3b036dace (diff) |
i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target
The len variable is not initialized, which may cause the for loop to
behave unexpectedly.
Fixes: 9b25419ad397 ("i2c: amd-asf: Add routine to handle the ASF slave process")
Signed-off-by: Qianqiang Liu <qianqiang.liu@163.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
-rw-r--r-- | drivers/i2c/busses/i2c-amd-asf-plat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index 47e0c90341ae..ba47df5370c7 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); |