diff mbox

[dpdk-dev] crypto/scheduler: fix name parameter parsing

Message ID 1485775153-237825-1-git-send-email-roy.fan.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Zhang, Roy Fan Jan. 30, 2017, 11:19 a.m. UTC
This patch fixes the name parsing issue. Originally, the unique
scheduler name created by system is not passed to vdev
initializer.

Fixes: 8b483eae ("crypto/scheduler: register scheduler vdev driver")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 drivers/crypto/scheduler/scheduler_pmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

De Lara Guarch, Pablo Jan. 30, 2017, 4:46 p.m. UTC | #1
> -----Original Message-----
> From: Zhang, Roy Fan
> Sent: Monday, January 30, 2017 11:19 AM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo
> Subject: [PATCH] crypto/scheduler: fix name parameter parsing
> 
> This patch fixes the name parsing issue. Originally, the unique
> scheduler name created by system is not passed to vdev
> initializer.
> 
> Fixes: 8b483eae ("crypto/scheduler: register scheduler vdev driver")
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---

Applied to dpdk-next-crypto and merged to "crypto/scheduler: register scheduler vdev driver".
Thanks,

Pablo
diff mbox

Patch

diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 62418d0..eeafbe6 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -116,19 +116,22 @@  static int
 cryptodev_scheduler_create(const char *name,
 	struct scheduler_init_params *init_params)
 {
-	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
+	char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN] = {0};
 	struct rte_cryptodev *dev;
 	struct scheduler_ctx *sched_ctx;
 
 	if (init_params->def_p.name[0] == '\0') {
 		int ret = rte_cryptodev_pmd_create_dev_name(
-				init_params->def_p.name,
+				crypto_dev_name,
 				RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
 
 		if (ret < 0) {
 			CS_LOG_ERR("failed to create unique name");
 			return ret;
 		}
+	} else {
+		strncpy(crypto_dev_name, init_params->def_p.name,
+				RTE_CRYPTODEV_NAME_MAX_LEN - 1);
 	}
 
 	dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,