Thread (3 messages) 3 messages, 2 authors, 2d ago
WARM2d

[PATCH] net: qualcomm: emac: replace strcpy() with strscpy()

From: Hungyu Lin <hidden>
Date: 2026-06-07 15:44:39
Also in: lkml
Subsystem: networking drivers, qualcomm emac gigabit ethernet driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Timur Tabi, Linus Torvalds

Replace strcpy() with strscpy() in emac_get_strings().

strscpy() is the preferred string copy helper in the kernel and
provides better bounds checking semantics.

Signed-off-by: Hungyu Lin <redacted>
---
 drivers/net/ethernet/qualcomm/emac/emac-ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
index f502db9cdea9..ffc300641aac 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
@@ -95,7 +95,7 @@ static void emac_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
 
 	switch (stringset) {
 	case ETH_SS_PRIV_FLAGS:
-		strcpy(data, "single-pause-mode");
+		strscpy(data, "single-pause-mode", ETH_GSTRING_LEN);
 		break;
 
 	case ETH_SS_STATS:
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help