From: Qianqiang Liu <qianqiang.liu@163.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: andi.shyti@kernel.org, shyam-sundar.s-k@amd.com,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target
Date: Fri, 27 Sep 2024 21:34:44 +0800 [thread overview]
Message-ID: <Zva0dBAZWpd1e4as@iZbp1asjb3cy8ks0srf007Z> (raw)
In-Reply-To: <cc527d62-7d0b-42f8-b14c-6448d3665989@stanley.mountain>
The len variable is not initialized, which may cause the for loop to
behave unexpectedly.
Fixes: 20c3cc299218 ("i2c: amd-asf: Add routine to handle the ASF slave process")
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
next prev parent reply other threads:[~2024-09-27 13:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 15:13 [PATCH] " Qianqiang Liu
2024-09-27 10:32 ` Dan Carpenter
2024-09-27 13:34 ` Qianqiang Liu [this message]
2024-09-27 13:37 ` [PATCH v2] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zva0dBAZWpd1e4as@iZbp1asjb3cy8ks0srf007Z \
--to=qianqiang.liu@163.com \
--cc=andi.shyti@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shyam-sundar.s-k@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®