public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] myri10ge: avoid passing uninitialized data to inline asm
@ 2026-02-03 23:04 Arnd Bergmann
  2026-02-03 23:04 ` [PATCH 2/2] [v3] myri10ge: avoid uninitialized variable use Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2026-02-03 23:04 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew J. Gallatin, Brice Goglin, Jeff Garzik
  Cc: Arnd Bergmann, Ingo Molnar, Thomas Gleixner, Bjorn Helgaas,
	Lukas Wunner, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building with gcc-16.0.1 find a bug with the inline asm:

In file included from include/linux/io.h:12,
                 from drivers/net/ethernet/myricom/myri10ge/myri10ge.c:43:
In function '__const_memcpy_toio_aligned64',
    inlined from '__iowrite64_copy' at arch/arm64/include/asm/io.h:249:3,
    inlined from 'myri10ge_dummy_rdma' at drivers/net/ethernet/myricom/myri10ge/myri10ge.c:535:2:
arch/arm64/include/asm/io.h:206:17: error: '*(const u64 *)(&buf[6])' is used uninitialized [-Werror=uninitialized]
  206 |                 asm volatile("str %x0, [%8, #8 * 0]\n"
      |                 ^~~

Set the extra fields to zero before writing them to hardware.

Fixes: 0da34b6dfe55 ("[PATCH] Add Myri-10G Ethernet driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 7be30a8df268..cea28aa971cc 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -508,7 +508,7 @@ static int myri10ge_read_mac_addr(struct myri10ge_priv *mgp)
 static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable)
 {
 	char __iomem *submit;
-	__be32 buf[16] __attribute__ ((__aligned__(8)));
+	__be32 buf[16] __attribute__ ((__aligned__(8))) = {};
 	u32 dma_low, dma_high;
 	int i;
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-05 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 23:04 [PATCH 1/2] myri10ge: avoid passing uninitialized data to inline asm Arnd Bergmann
2026-02-03 23:04 ` [PATCH 2/2] [v3] myri10ge: avoid uninitialized variable use Arnd Bergmann
2026-02-05  4:57   ` [2/2,v3] " Jakub Kicinski
2026-02-05 16:30     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox