common/octeontx2: add mailbox send and receive support
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.c
index cdc586a..00c2cf4 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;