diff options
author | 2025-06-20 15:55:59 +0530 | |
---|---|---|
committer | 2025-06-23 16:56:21 -0700 | |
commit | ae2402bf882b40fb9cf3b6a5c9ff0e6c7a9ef842 (patch) | |
tree | b4d8b07c5dde1d059fd63baeb611e1691e408718 | |
parent | dt-bindings: net: convert qca,qca7000.txt yaml format (diff) | |
download | wireguard-linux-ae2402bf882b40fb9cf3b6a5c9ff0e6c7a9ef842.tar.xz wireguard-linux-ae2402bf882b40fb9cf3b6a5c9ff0e6c7a9ef842.zip |
net/smc: replace strncpy with strscpy
Replace the deprecated strncpy() with two-argument version of
strscpy() as the destination is an array
and should be NUL-terminated.
Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250620102559.6365-1-pranav.tyagi03@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | net/smc/smc_pnet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index b391c2ef463f..76ad29e31d60 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c @@ -370,7 +370,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, goto out_put; new_pe->type = SMC_PNET_ETH; memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN); - strncpy(new_pe->eth_name, eth_name, IFNAMSIZ); + strscpy(new_pe->eth_name, eth_name); rc = -EEXIST; new_netdev = true; mutex_lock(&pnettable->lock); |