From 03f8a9270eb03b0706a4cc151a847064f5678533 Mon Sep 17 00:00:00 2001 From: Bernard Iremonger Date: Wed, 7 Aug 2019 13:30:12 +0100 Subject: [PATCH] examples/ipsec-secgw: fix unchecked return value [ upstream commit 23742f21f74a9d8380367c39b8ee4561e6dd1526 ] 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") Signed-off-by: Bernard Iremonger Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index 872a8b8198..0f94a76a98 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -200,8 +200,14 @@ create_session(struct ipsec_ctx *ipsec_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, + 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;