public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Purva Yeshi <purvayeshi550@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: yujiaoliang@vivo.com, jkeeping@inmusicbrands.com,
	oliver.graute@kococonnector.com, viro@zeniv.linux.org.uk,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Purva Yeshi <purvayeshi550@gmail.com>
Subject: [PATCH] input: ili210x: Fix uninitialized symbols in ili251x_firmware_to_buffer
Date: Sat, 19 Apr 2025 18:43:15 +0530	[thread overview]
Message-ID: <20250419131315.24897-1-purvayeshi550@gmail.com> (raw)

Fix Smatch-detected issue:

drivers/input/touchscreen/ili210x.c:621 ili251x_firmware_to_buffer()
error: uninitialized symbol 'fw_addr'.
drivers/input/touchscreen/ili210x.c:621 ili251x_firmware_to_buffer()
error: uninitialized symbol 'fw_len'.

Initialize 'fw_addr' and 'fw_len' to 0 in ili251x_firmware_to_buffer()
to avoid uninitialized use warnings reported by smatch.

Although the while loop ensures both variables are always assigned before
use, initializing them silences false positives.

Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
---
 drivers/input/touchscreen/ili210x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index fa38d70aded7..10b52d87c41a 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -586,8 +586,8 @@ static const u8 *ili251x_firmware_to_buffer(const struct firmware *fw,
 					    u16 *ac_end, u16 *df_end)
 {
 	const struct ihex_binrec *rec;
-	u32 fw_addr, fw_last_addr = 0;
-	u16 fw_len;
+	u32 fw_addr = 0, fw_last_addr = 0;
+	u16 fw_len = 0;
 
 	/*
 	 * The firmware ihex blob can never be bigger than 64 kiB, so make this
-- 
2.34.1


             reply	other threads:[~2025-04-19 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 13:13 Purva Yeshi [this message]
2025-04-23  7:30 ` [PATCH] input: ili210x: Fix uninitialized symbols in ili251x_firmware_to_buffer Oliver Graute
2025-04-29  1:24   ` dmitry.torokhov

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=20250419131315.24897-1-purvayeshi550@gmail.com \
    --to=purvayeshi550@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkeeping@inmusicbrands.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.graute@kococonnector.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yujiaoliang@vivo.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