Check if virtual device name is NULL,
to avoid possible segmentation faults.
Fixes:
5d2aa461cbca ("vdev: use generic vdev struct for probe and remove")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
rte_socket_id(),
{0}
};
+ const char *name;
- rte_cryptodev_parse_vdev_init_params(&init_params,
- rte_vdev_device_args(dev));
+ name = rte_vdev_device_name(dev);
+ if (name == NULL)
+ return -EINVAL;
RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n",
- rte_vdev_device_name(dev), init_params.socket_id);
+ name, init_params.socket_id);
if (init_params.name[0] != '\0')
RTE_LOG(INFO, PMD, " User defined name = %s\n",
init_params.name);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
.enable_ordering = 0,
.slave_names = { {0} }
};
+ const char *name;
+
+ name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
scheduler_parse_init_params(&init_params,
rte_vdev_device_args(vdev));
RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n",
- rte_vdev_device_name(vdev),
+ name,
init_params.def_p.socket_id);
RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n",
init_params.def_p.max_nb_queue_pairs);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
const char *input_args;
name = rte_vdev_device_name(vdev);
+ if (name == NULL)
+ return -EINVAL;
input_args = rte_vdev_device_args(vdev);
rte_cryptodev_parse_vdev_init_params(&init_params, input_args);