[09/25] crypto/dpaa_sec: replace snprintf with strlcpy

Message ID 20230601150106.18375-10-stephen@networkplumber.org (mailing list archive)
State Rejected
Delegated to: Thomas Monjalon
Headers
Series replace snprintf with strlcpy |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger June 1, 2023, 3 p.m. UTC
  Suggested by devtools/cocci/strlcpy-with-header.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Hemant Agrawal June 2, 2023, 4:24 a.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  

Patch

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index db5268384786..0df3a9f1e9b9 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3740,7 +3740,7 @@  cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name);
+	strlcpy(cryptodev_name, dpaa_dev->name, sizeof(cryptodev_name));
 
 	cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id());
 	if (cryptodev == NULL)