]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_cryptodev/rte_cryptodev.c
common/octeontx2: add mailbox send and receive support
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.c
index cdc586a8a0225d24cddd8605ac8e817a2b8b1b6c..00c2cf432f597e4262a5bae7094b87d1eb21a528 100644 (file)
@@ -698,8 +698,8 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
 
                cryptodev->data = cryptodev_data;
 
-               snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
-                               "%s", name);
+               strlcpy(cryptodev->data->name, name,
+                       RTE_CRYPTODEV_NAME_MAX_LEN);
 
                cryptodev->data->dev_id = dev_id;
                cryptodev->data->socket_id = socket_id;
@@ -1386,6 +1386,8 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
                return -EINVAL;
 
        driver_id = dev->driver_id;
+       if (sess->sess_data[driver_id].refcnt == 0)
+               return 0;
        if (--sess->sess_data[driver_id].refcnt != 0)
                return -EBUSY;