[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231016094831.139939-1-jiawenwu@trustnetic.com>
Date: Mon, 16 Oct 2023 17:48:31 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
netdev@...r.kernel.org
Cc: mengyuanlou@...-swift.com,
Jiawen Wu <jiawenwu@...stnetic.com>
Subject: [PATCH] net: txgbe: clean up PBA string
Replace deprecated strncpy with strscpy, and add the missing PBA prints.
This issue is reported by: Justin Stitt <justinstitt@...gle.com>
Link: https://lore.kernel.org/netdev/002101d9ffdd$9ea59f90$dbf0deb0$@trustnetic.com/T/#t
Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
---
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
index 394f699c51da..123e3ca78ef0 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
@@ -741,8 +741,9 @@ static int txgbe_probe(struct pci_dev *pdev,
/* First try to read PBA as a string */
err = txgbe_read_pba_string(wx, part_str, TXGBE_PBANUM_LENGTH);
if (err)
- strncpy(part_str, "Unknown", TXGBE_PBANUM_LENGTH);
+ strscpy(part_str, "Unknown", sizeof(part_str));
+ netif_info(wx, probe, netdev, "PBA No: %s\n", part_str);
netif_info(wx, probe, netdev, "%pM\n", netdev->dev_addr);
return 0;
--
2.27.0
Powered by blists - more mailing lists