struct rte_event_port_conf *port_conf = arg;
struct rte_event_crypto_adapter *adapter = eca_id_to_adapter(id);
+ if (adapter == NULL)
+ return -EINVAL;
+
dev = &rte_eventdevs[adapter->eventdev_id];
dev_conf = dev->data->dev_conf;
cdev_id = m_data->request_info.cdev_id;
qp_id = m_data->request_info.queue_pair_id;
qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
- if (qp_info == NULL) {
+ if (!qp_info->qp_enabled) {
rte_pktmbuf_free(crypto_op->sym->m_src);
rte_crypto_op_free(crypto_op);
continue;
cdev_id = m_data->request_info.cdev_id;
qp_id = m_data->request_info.queue_pair_id;
qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
- if (qp_info == NULL) {
+ if (!qp_info->qp_enabled) {
rte_pktmbuf_free(crypto_op->sym->m_src);
rte_crypto_op_free(crypto_op);
continue;
ret = 0;
for (cdev_id = 0; cdev_id < num_cdev; cdev_id++) {
curr_dev = &adapter->cdevs[cdev_id];
- if (curr_dev == NULL)
- continue;
dev = curr_dev->dev;
-
+ if (dev == NULL)
+ continue;
for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
curr_queue = &curr_dev->qpairs[qp];
for (cdev_id = adapter->next_cdev_id;
cdev_id < num_cdev; cdev_id++) {
curr_dev = &adapter->cdevs[cdev_id];
- if (curr_dev == NULL)
- continue;
dev = curr_dev->dev;
+ if (dev == NULL)
+ continue;
dev_qps = dev->data->nb_queue_pairs;
for (qp = curr_dev->next_queue_pair_id;