]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target
authorQianqiang Liu <qianqiang.liu@163.com>
Fri, 27 Sep 2024 13:34:44 +0000 (21:34 +0800)
committerAndi Shyti <andi.shyti@kernel.org>
Sun, 17 Nov 2024 10:57:29 +0000 (11:57 +0100)
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>
drivers/i2c/busses/i2c-amd-asf-plat.c

index 47e0c90341aed1a94323a20d85826251e58760e7..ba47df5370c72e0af6c84e84ce071c20b4dca803 100644 (file)
@@ -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);