{
struct rte_crypto_sym_xform *first_xform;
struct rte_cryptodev_sym_session *session;
- uint8_t socket_id = rte_cryptodev_socket_id(cdev_id);
+ int retval = rte_cryptodev_socket_id(cdev_id);
+
+ if (retval < 0)
+ return NULL;
+
+ uint8_t socket_id = (uint8_t) retval;
struct rte_mempool *sess_mp = session_pool_socket[socket_id];
if (options->xform_chain == L2FWD_CRYPTO_AEAD) {
unsigned byte_count;
char *token;
+ errno = 0;
for (byte_count = 0, token = strtok(input_arg, ":");
(byte_count < MAX_KEY_SIZE) && (token != NULL);
token = strtok(NULL, ":")) {
cdev_id++) {
struct rte_cryptodev_qp_conf qp_conf;
struct rte_cryptodev_info dev_info;
- uint8_t socket_id = rte_cryptodev_socket_id(cdev_id);
+ retval = rte_cryptodev_socket_id(cdev_id);
+
+ if (retval < 0) {
+ printf("Invalid crypto device id used\n");
+ return -1;
+ }
+
+ uint8_t socket_id = (uint8_t) retval;
struct rte_cryptodev_config conf = {
.nb_queue_pairs = 1,