* [net] net: ethernet: adi: adin1110: Fix uninitialized variable
@ 2023-10-20 6:20 Ciprian Regus
2023-10-24 0:11 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Ciprian Regus @ 2023-10-20 6:20 UTC (permalink / raw)
To: linux-kernel
Cc: Ciprian Regus, Dell Jin, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Alexandru Tachici, Andrew Lunn,
Simon Horman, Yang Yingliang, Amit Kumar Mahapatra, netdev
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net] net: ethernet: adi: adin1110: Fix uninitialized variable
2023-10-20 6:20 [net] net: ethernet: adi: adin1110: Fix uninitialized variable Ciprian Regus
@ 2023-10-24 0:11 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2023-10-24 0:11 UTC (permalink / raw)
To: Ciprian Regus
Cc: linux-kernel, Dell Jin, David S. Miller, Eric Dumazet,
Paolo Abeni, Alexandru Tachici, Andrew Lunn, Simon Horman,
Yang Yingliang, Amit Kumar Mahapatra, netdev
On Fri, 20 Oct 2023 09:20:53 +0300 Ciprian Regus wrote:
> 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")
Applied, thank you!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-24 0:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 6:20 [net] net: ethernet: adi: adin1110: Fix uninitialized variable Ciprian Regus
2023-10-24 0:11 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).