Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: qualcomm: emac: replace strcpy() with strscpy()
@ 2026-06-07 15:44 Hungyu Lin
  2026-06-10  1:39 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Hungyu Lin @ 2026-06-07 15:44 UTC (permalink / raw)
  To: timur, netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, linux-kernel,
	Hungyu Lin

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 <dennylin0707@gmail.com>
---
 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


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

end of thread, other threads:[~2026-06-10  3:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-07 15:44 [PATCH] net: qualcomm: emac: replace strcpy() with strscpy() Hungyu Lin
2026-06-10  1:39 ` Jakub Kicinski
2026-06-10  3:33   ` Hungyu Lin

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