examples/ipsec-secgw: fix unchecked return value
authorBernard Iremonger <bernard.iremonger@intel.com>
Wed, 7 Aug 2019 12:30:12 +0000 (13:30 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 9 Oct 2019 09:50:12 +0000 (11:50 +0200)
Check the return value of the rte_eth_dev_rss_hash_conf_get function.

Coverity issue: 344970
Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline crypto")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw/ipsec.c

index dc85adf..5f9d560 100644 (file)
@@ -248,7 +248,14 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa)
                        /* Try RSS. */
                        sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
                        sa->action[1].conf = &action_rss;
-                       rte_eth_dev_rss_hash_conf_get(sa->portid, &rss_conf);
+                       ret = rte_eth_dev_rss_hash_conf_get(sa->portid,
+                                       &rss_conf);
+                       if (ret != 0) {
+                               RTE_LOG(ERR, IPSEC,
+                                       "rte_eth_dev_rss_hash_conf_get:ret=%d\n",
+                                       ret);
+                               return -1;
+                       }
                        for (i = 0, j = 0; i < dev_info.nb_rx_queues; ++i)
                                queue[j++] = i;