Skip to content

Commit a5089cd

Browse files
Qianqiang LiuAndi Shyti
authored andcommitted
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: 9b25419 ("i2c: amd-asf: Add routine to handle the ASF slave process") Signed-off-by: Qianqiang Liu <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Acked-by: Shyam Sundar S K <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 63ae99f commit a5089cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-amd-asf-plat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void amd_asf_process_target(struct work_struct *work)
6161
unsigned short piix4_smba = dev->port_addr->start;
6262
u8 data[ASF_BLOCK_MAX_BYTES];
6363
u8 bank, reg, cmd;
64-
u8 len, idx, val;
64+
u8 len = 0, idx, val;
6565

6666
/* Read target status register */
6767
reg = inb_p(ASFSLVSTA);

0 commit comments

Comments
 (0)