From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F0E9A04E7 for ; Thu, 5 Nov 2020 14:51:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 49276C814; Thu, 5 Nov 2020 14:51:23 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CB3B7C7F6; Thu, 5 Nov 2020 14:51:19 +0100 (CET) IronPort-SDR: v9LSK3is7Q4i/wrtr5iC0qA64PBS9L/2LmHmtocrsQ+w6p0m1pf8a3Zu9TXGekdNnfHNMVy7uA iMUDxWhPxhBg== X-IronPort-AV: E=McAfee;i="6000,8403,9795"; a="169524532" X-IronPort-AV: E=Sophos;i="5.77,453,1596524400"; d="scan'208";a="169524532" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 05:51:18 -0800 IronPort-SDR: jf8csJsPrBiAwXORb0asPqtGFVuppVQ/xo/qipuSDDU4AygoDN4bmJqE/88X7wscX7u4CXgByE qMQCgbQ7TEng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,453,1596524400"; d="scan'208";a="539407321" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.222.38]) by orsmga005.jf.intel.com with ESMTP; 05 Nov 2020 05:51:17 -0800 From: David Hunt To: dev@dpdk.org Cc: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, stable@dpdk.org, David Hunt Date: Thu, 5 Nov 2020 13:51:14 +0000 Message-Id: <20201105135114.10920-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] mempool: fix ignore return value Coverity issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Coverity flags that rte_mempool_ops_dequeue_bulk() is called without checking the return value. This ignoring is intentional, so this patch gets the return code, then uses RTE_SET_USED so that Coverity will be happy. Coverity issue: 363744 Fixes: 449c49b93a6b ("mempool: support handler operations") Cc: stable@dpdk.org Signed-off-by: David Hunt --- lib/librte_mempool/rte_mempool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index b9f3fbd61..2980b1a00 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -270,9 +270,11 @@ rte_mempool_free_memchunks(struct rte_mempool *mp) { struct rte_mempool_memhdr *memhdr; void *elt; + int ret; while (!STAILQ_EMPTY(&mp->elt_list)) { - rte_mempool_ops_dequeue_bulk(mp, &elt, 1); + ret = rte_mempool_ops_dequeue_bulk(mp, &elt, 1); + RTE_SET_USED(ret); /* Intentionally ignored */ (void)elt; STAILQ_REMOVE_HEAD(&mp->elt_list, next); mp->populated_size--; -- 2.17.1