From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1D1AB29D2 for ; Thu, 7 Apr 2016 13:42:41 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 07 Apr 2016 04:42:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="950056264" Received: from gklab-246-018.igk.intel.com (HELO stargo) ([10.217.246.18]) by orsmga002.jf.intel.com with SMTP; 07 Apr 2016 04:42:38 -0700 Received: by stargo (sSMTP sendmail emulation); Thu, 07 Apr 2016 13:48:29 +0200 From: Slawomir Mrozowicz To: thomas.monjalon@6wind.com Cc: dev@dpdk.org, Slawomir Mrozowicz Date: Thu, 7 Apr 2016 13:46:32 +0200 Message-Id: <1460029592-11964-1-git-send-email-slawomirx.mrozowicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] ethdev: fix CID 124557 unchecked return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2016 11:42:42 -0000 It fix coverity issue: CID 124557 (#1 of 1): Unchecked return value (CHECKED_RETURN) 3. check_return: Calling rte_eth_tx_buffer_set_err_callback without checking return value (as is done elsewhere 6 out of 7 times). Fixes: d6c99e62c852 ("ethdev: add buffered Tx") Signed-off-by: Slawomir Mrozowicz --- lib/librte_ether/rte_ethdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index dcf9e6f..0dc1025 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1342,15 +1342,19 @@ rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer, int rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) { + int ret_val = 0; + if (buffer == NULL) return -EINVAL; buffer->size = size; - if (buffer->error_callback == NULL) - rte_eth_tx_buffer_set_err_callback(buffer, - rte_eth_tx_buffer_drop_callback, NULL); + if (buffer->error_callback == NULL) { - return 0; + ret_val = rte_eth_tx_buffer_set_err_callback( + buffer, rte_eth_tx_buffer_drop_callback, NULL); + } + + return ret_val; } void -- 1.9.1 -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.