From: Ciprian Regus <ciprian.regus@analog.com>
To: <linux-kernel@vger.kernel.org>
Cc: Ciprian Regus <ciprian.regus@analog.com>,
Dell Jin <dell.jin.code@outlook.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexandru Tachici <alexandru.tachici@analog.com>,
"Andrew Lunn" <andrew@lunn.ch>, Simon Horman <horms@kernel.org>,
Yang Yingliang <yangyingliang@huawei.com>,
Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>,
<netdev@vger.kernel.org>
Subject: [net] net: ethernet: adi: adin1110: Fix uninitialized variable
Date: Fri, 20 Oct 2023 09:20:53 +0300 [thread overview]
Message-ID: <20231020062055.449185-1-ciprian.regus@analog.com> (raw)
From: Dell Jin <dell.jin.code@outlook.com>
The spi_transfer struct has to have all it's fields initialized to 0 in
this case, since not all of them are set before starting the transfer.
Otherwise, spi_sync_transfer() will sometimes return an error.
Fixes: a526a3cc9c8d ("net: ethernet: adi: adin1110: Fix SPI transfers")
Signed-off-by: Dell Jin <dell.jin.code@outlook.com>
Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
---
drivers/net/ethernet/adi/adin1110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index ca66b747b7c5..d7c274af6d4d 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -296,3 +296,3 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv)
u32 header_len = ADIN1110_RD_HEADER_LEN;
- struct spi_transfer t;
+ struct spi_transfer t = {0};
u32 frame_size_no_fcs;
--
2.39.2
next reply other threads:[~2023-10-20 6:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 6:20 Ciprian Regus [this message]
2023-10-24 0:11 ` Jakub Kicinski
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=20231020062055.449185-1-ciprian.regus@analog.com \
--to=ciprian.regus@analog.com \
--cc=alexandru.tachici@analog.com \
--cc=amit.kumar-mahapatra@amd.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dell.jin.code@outlook.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yangyingliang@huawei.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®