From: Purva Yeshi <purvayeshi550@gmail.com>
To: o-takashi@sakamocchi.jp
Cc: linux1394-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org,
Purva Yeshi <purvayeshi550@gmail.com>
Subject: [PATCH] firewire: ohci: Initialize payload_bus to avoid uninitialized use warning
Date: Thu, 10 Jul 2025 13:09:06 +0530 [thread overview]
Message-ID: <20250710073906.24105-1-purvayeshi550@gmail.com> (raw)
Fix Smatch-detected error:
drivers/firewire/ohci.c:1514 at_context_queue_packet()
error: uninitialized symbol 'payload_bus'.
Smatch reports a potential uninitialized use of 'payload_bus' in
at_context_queue_packet(). If packet->payload_length is zero, the
variable may not be set before reaching the dma_unmap_single() call,
which could lead to undefined behavior.
Initialize 'payload_bus' to 0 to ensure it has a defined value in all
code paths, preventing any uninitialized access.
Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
---
drivers/firewire/ohci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index edaedd156a6d..c05d90511f2b 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -1392,7 +1392,7 @@ static int at_context_queue_packet(struct context *ctx,
struct fw_packet *packet)
{
struct fw_ohci *ohci = ctx->ohci;
- dma_addr_t d_bus, payload_bus;
+ dma_addr_t d_bus, payload_bus = 0;
struct driver_data *driver_data;
struct descriptor *d, *last;
__le32 *header;
--
2.34.1
next reply other threads:[~2025-07-10 7:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 7:39 Purva Yeshi [this message]
2025-07-10 12:52 ` Takashi Sakamoto
2025-07-10 15:10 ` Purva Yeshi
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=20250710073906.24105-1-purvayeshi550@gmail.com \
--to=purvayeshi550@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=o-takashi@sakamocchi.jp \
/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®