DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix CID 124557 unchecked return value
Date: Thu, 07 Apr 2016 19:09:12 +0200	[thread overview]
Message-ID: <3036379.8Bd6VsXgNg@xps13> (raw)
In-Reply-To: <1460029592-11964-1-git-send-email-slawomirx.mrozowicz@intel.com>

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 <slawomirx.mrozowicz@intel.com>
|...]
|> --- 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 :)

      reply	other threads:[~2016-04-07 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 11:46 Slawomir Mrozowicz
2016-04-07 17:09 ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3036379.8Bd6VsXgNg@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=slawomirx.mrozowicz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).