@@ -229,8 +229,7 @@ test_cmdline_fns(void)
error:
printf("Error: function accepted null parameter!\n");
- if (cl != NULL)
- cmdline_free(cl);
+ cmdline_free(cl);
return -1;
}
@@ -1451,8 +1451,7 @@ ut_teardown(void)
}
/* free crypto operation structure */
- if (ut_params->op)
- rte_crypto_op_free(ut_params->op);
+ rte_crypto_op_free(ut_params->op);
/*
* free mbuf - both obuf and ibuf are usually the same,
@@ -11653,8 +11652,7 @@ test_multi_session(void)
aes_cbc_iv),
"Failed to perform decrypt on request number %u.", i);
/* free crypto operation structure */
- if (ut_params->op)
- rte_crypto_op_free(ut_params->op);
+ rte_crypto_op_free(ut_params->op);
/*
* free mbuf - both obuf and ibuf are usually the same,
@@ -11797,8 +11795,7 @@ test_multi_session_random_usage(void)
ut_paramz[j].iv),
"Failed to perform decrypt on request number %u.", i);
- if (ut_paramz[j].ut_params.op)
- rte_crypto_op_free(ut_paramz[j].ut_params.op);
+ rte_crypto_op_free(ut_paramz[j].ut_params.op);
/*
* free mbuf - both obuf and ibuf are usually the same,
@@ -507,8 +507,7 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
rte_free(result);
@@ -1114,8 +1113,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
error_exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -1193,8 +1191,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
error_exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -1283,8 +1280,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
error_exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -1370,8 +1366,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
error_exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -1481,8 +1476,7 @@ test_mod_inv(void)
if (sess)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
TEST_ASSERT_EQUAL(status, 0, "Test failed");
@@ -1593,8 +1587,7 @@ test_mod_exp(void)
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
TEST_ASSERT_EQUAL(status, 0, "Test failed");
@@ -1758,8 +1751,7 @@ test_dsa_sign(void)
error_exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -1947,8 +1939,7 @@ test_ecdsa_sign_verify(enum curve curve_id)
exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
};
@@ -2109,8 +2100,7 @@ test_ecpm(enum curve curve_id)
exit:
if (sess != NULL)
rte_cryptodev_asym_session_free(dev_id, sess);
- if (op != NULL)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
return status;
}
@@ -811,8 +811,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
rte_free(auth_xform);
}
- if (op)
- rte_crypto_op_free(op);
+ rte_crypto_op_free(op);
rte_pktmbuf_free(obuf);
@@ -278,8 +278,7 @@ fbk_clean(unsigned lcore_id)
int i;
handle = rte_fbk_hash_find_existing("fr_test_once");
- if (handle != NULL)
- rte_fbk_hash_free(handle);
+ rte_fbk_hash_free(handle);
for (i = 0; i < MAX_ITER_MULTI; i++) {
snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i);
@@ -1159,8 +1159,7 @@ fbk_hash_unit_test(void)
RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded");
tmp = rte_fbk_hash_create(&invalid_params_same_name_2);
- if (tmp != NULL)
- rte_fbk_hash_free(tmp);
+ rte_fbk_hash_free(tmp);
RETURN_IF_ERROR_FBK(tmp != NULL, "fbk hash creation should have failed");
/* we are not freeing handle here because we need a hash list