DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: dev@dpdk.org
Cc: Kevin Traynor <ktraynor@redhat.com>, rosen.xu@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic
Date: Tue,  1 Oct 2019 14:04:00 +0100	[thread overview]
Message-ID: <20191001130405.7076-3-ktraynor@redhat.com> (raw)
In-Reply-To: <20191001130405.7076-1-ktraynor@redhat.com>

Coverity is complaining about identical code regardless of which branch
of the if else is taken. Functionally it means an error will always be
returned if this if else is hit. Remove the else branch.

    CID 337928 (#1 of 1): Identical code for different branches
    (IDENTICAL_BRANCHES)identical_branches: The same code is executed
    regardless of whether n->level != IPN3KE_TM_NODE_LEVEL_COS ||
    n->n_children != 0U is true, because the 'then' and 'else' branches
    are identical. Should one of the branches be modified, or the entire
    'if' statement replaced?
1506  if (n->level != IPN3KE_TM_NODE_LEVEL_COS ||
1507          n->n_children != 0) {
1508          return -rte_tm_error_set(error,
1509                  EINVAL,
1510                  RTE_TM_ERROR_TYPE_UNSPECIFIED,
1511                  NULL,
1512                  rte_strerror(EINVAL));
    else_branch: The else branch, identical to the then branch.
1513  } else {
1514          return -rte_tm_error_set(error,
1515                  EINVAL,
1516                  RTE_TM_ERROR_TYPE_UNSPECIFIED,
1517                  NULL,
1518                  rte_strerror(EINVAL));
1519  }

Coverity issue: 337928
Fixes: c820468ac99c ("net/ipn3ke: support TM")
Cc: rosen.xu@intel.com
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 drivers/net/ipn3ke/ipn3ke_tm.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index adf02c157..a93145d59 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -1511,10 +1511,4 @@ ipn3ke_tm_hierarchy_commit_check(struct rte_eth_dev *dev,
 						NULL,
 						rte_strerror(EINVAL));
-			} else {
-				return -rte_tm_error_set(error,
-						EINVAL,
-						RTE_TM_ERROR_TYPE_UNSPECIFIED,
-						NULL,
-						rte_strerror(EINVAL));
 			}
 		}
-- 
2.21.0


  parent reply	other threads:[~2019-10-01 13:04 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 12:53 [dpdk-dev] [PATCH 0/9] Coverity fixes and other cleanups Kevin Traynor
2019-10-01 12:53 ` [dpdk-dev] [PATCH 1/9] net/pcap: fix argument checks Kevin Traynor
2019-10-04 10:57   ` Ferriter, Cian
2019-10-30  7:52   ` David Marchand
2019-11-05 16:40     ` Kevin Traynor
2019-11-05 17:10       ` Ferriter, Cian
2019-11-06 19:03         ` Kevin Traynor
2019-10-01 13:03 ` [dpdk-dev] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
2019-10-01 13:03   ` [dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code Kevin Traynor
2019-10-02  1:28     ` Ajit Khaparde
2019-10-30  7:43       ` David Marchand
2019-10-30 16:27         ` Ajit Khaparde
2019-11-05 15:39           ` Kevin Traynor
2019-10-01 13:04   ` Kevin Traynor [this message]
2019-10-30  7:59     ` [dpdk-dev] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic David Marchand
2019-11-05 15:41       ` Kevin Traynor
2019-11-08 14:45         ` Xu, Rosen
2019-11-08 14:47           ` Kevin Traynor
2019-11-08 14:35       ` Xu, Rosen
2019-11-08 14:52     ` Xu, Rosen
2019-10-01 13:04   ` [dpdk-dev] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
2019-10-30  8:01     ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-08 14:35       ` Xu, Rosen
2019-11-08 14:52     ` [dpdk-dev] " Xu, Rosen
2019-10-01 13:04   ` [dpdk-dev] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
2019-10-30  8:04     ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-08 14:40       ` Xu, Rosen
2019-11-08 14:51     ` [dpdk-dev] " Xu, Rosen
2019-10-01 13:04   ` [dpdk-dev] [PATCH 7/9] compress/octeontx: " Kevin Traynor
2019-10-30  8:06     ` David Marchand
2019-10-01 13:04   ` [dpdk-dev] [PATCH 8/9] event/opdl: " Kevin Traynor
2019-10-03 10:50     ` Liang, Ma
2019-10-01 13:04   ` [dpdk-dev] [PATCH 9/9] net/bnxt: " Kevin Traynor
2019-10-01 15:42     ` Ajit Khaparde
2019-10-30  7:56   ` [dpdk-dev] [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference David Marchand
2019-11-06 19:01 ` [dpdk-dev] [v2 PATCH 0/8] Coverity fixes and other cleanups Kevin Traynor
2019-11-06 19:01   ` [dpdk-dev] [v2 PATCH 1/8] net/pcap: fix argument checks Kevin Traynor
2019-11-06 19:01   ` [dpdk-dev] [v2 PATCH 2/8] common/cpt: fix possible NULL deference Kevin Traynor
2019-11-06 19:01   ` [dpdk-dev] [v2 PATCH 3/8] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
2019-11-08 14:50     ` Xu, Rosen
2019-11-06 19:01   ` [dpdk-dev] [v2 PATCH 4/8] net/ipn3ke: remove useless if statement Kevin Traynor
2019-11-08 14:49     ` Xu, Rosen
2019-11-06 19:02   ` [dpdk-dev] [v2 PATCH 5/8] net/ipn3ke: remove commented out code Kevin Traynor
2019-11-08 14:50     ` Xu, Rosen
2019-11-06 19:02   ` [dpdk-dev] [v2 PATCH 6/8] compress/octeontx: " Kevin Traynor
2019-11-06 19:02   ` [dpdk-dev] [v2 PATCH 7/8] event/opdl: " Kevin Traynor
2019-11-06 19:02   ` [dpdk-dev] [v2 PATCH 8/8] net/bnxt: " Kevin Traynor
2019-11-08 14:07   ` [dpdk-dev] [v2 PATCH 0/8] Coverity fixes and other cleanups David Marchand
2019-11-08 14:41     ` Xu, Rosen
2019-11-08 15:15       ` David Marchand

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=20191001130405.7076-3-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=dev@dpdk.org \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    /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).