DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 4/4] net/tap: fix warning about comparison of fd
Date: Tue,  6 Nov 2018 11:30:05 -0800	[thread overview]
Message-ID: <20181106193005.5383-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20181106193005.5383-1-stephen@networkplumber.org>

Static analysis tools don't like the fact that fd could be zero
in the error path. This won't happen in real world because
stdin would have to be closed, then other error occurring.

Coverity issue: 14079
Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/tap/rte_eth_tap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 84aaf241019a..f7087222b319 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -231,7 +231,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive)
 	return fd;
 
 error:
-	if (fd > 0)
+	if (fd >= 0)
 		close(fd);
 	return -1;
 }
-- 
2.17.1

  parent reply	other threads:[~2018-11-06 19:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 19:30 [dpdk-dev] [PATCH 0/4] Coverity issue fixes Stephen Hemminger
2018-11-06 19:30 ` [dpdk-dev] [PATCH 1/4] net/failsafe: avoid rte_memcpy if rte_realloc fails Stephen Hemminger
2018-11-07  6:30   ` Andrew Rybchenko
2018-11-07 18:15     ` Stephen Hemminger
2018-11-08  6:20       ` Andrew Rybchenko
2018-11-06 19:30 ` [dpdk-dev] [PATCH 2/4] bus/vmbus: fix directory handle leak on error Stephen Hemminger
2018-11-06 19:30 ` [dpdk-dev] [PATCH 3/4] net/tap: fix file descriptor " Stephen Hemminger
2018-11-07 10:02   ` Wiles, Keith
2018-11-06 19:30 ` Stephen Hemminger [this message]
2018-11-07 10:03   ` [dpdk-dev] [PATCH 4/4] net/tap: fix warning about comparison of fd Wiles, Keith
2018-11-14  1:00 ` [dpdk-dev] [PATCH 0/4] Coverity issue fixes Thomas Monjalon

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=20181106193005.5383-5-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@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).