pipeline: fix logically dead code
authorFan Zhang <roy.fan.zhang@intel.com>
Mon, 5 Nov 2018 12:27:02 +0000 (12:27 +0000)
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>
Mon, 12 Nov 2018 16:45:23 +0000 (17:45 +0100)
This patches fixes the coverity issue of logically dead code.

Coverity issue: 323523
Fixes: 96303217a606 ("pipeline: add symmetric crypto table action")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
lib/librte_pipeline/rte_table_action.c

index 537e659..7c7c8dd 100644 (file)
@@ -1694,10 +1694,9 @@ get_block_size(const struct rte_crypto_sym_xform *xform, uint8_t cdev_id)
 
        rte_cryptodev_info_get(cdev_id, &dev_info);
 
-       for (i = 0;; i++) {
+       for (i = 0; dev_info.capabilities[i].op != RTE_CRYPTO_OP_TYPE_UNDEFINED;
+                       i++) {
                cap = &dev_info.capabilities[i];
-               if (!cap)
-                       break;
 
                if (cap->sym.xform_type != xform->type)
                        continue;