From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ethdev: fix CID 124557 unchecked return value Date: Thu, 07 Apr 2016 19:09:12 +0200 Message-ID: <3036379.8Bd6VsXgNg@xps13> References: <1460029592-11964-1-git-send-email-slawomirx.mrozowicz@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Slawomir Mrozowicz Return-path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 5D20729D2 for ; Thu, 7 Apr 2016 19:09:14 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id u206so95901409wme.1 for ; Thu, 07 Apr 2016 10:09:14 -0700 (PDT) In-Reply-To: <1460029592-11964-1-git-send-email-slawomirx.mrozowicz@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-04-07 13:46, Slawomir Mrozowicz: > 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). Lines must be wrapped. > Fixes: d6c99e62c852 ("ethdev: add buffered Tx") > Signed-off-by: Slawomir Mrozowicz |...] |> --- 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; The name "ret" is more common in this file. > + > 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) { > This blank line can be removed. > - return 0; > + ret_val = rte_eth_tx_buffer_set_err_callback( > + buffer, rte_eth_tx_buffer_drop_callback, NULL); > + } > + > + return ret_val; > } Applied with above small changes, thanks and welcome :)