From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 695FA3238 for ; Tue, 6 Nov 2018 20:30:12 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id 32-v6so6259758pgu.2 for ; Tue, 06 Nov 2018 11:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6oBUCv7+phmIrDPpenUTh9zTN/opx5QeamKgnOqn6Ys=; b=cJLT08XP0VIStdikPSak071xLx0CHbTR0/3TIfM2yuSHBfAtrgjObPIeAa8NGDGZzP tgBt00YbnIHN5CfqKhpeyG+L7V3FOcXuZI5nEtAXdtIcR0MjX7Ru+9a602rOcofEeZUM V9c1J6cNKX69WP/ay5nJUKtKFeYH0YRYvjx0+yt3CLD9bghlcmUj8AL+0blfGahZhRi3 xkpTHvV06xMcOREfRFqnzpFCgzCc3/LomWbkWM5LbuzasspDIAl6YLcSdFgnNlNxCkEH fVk18Z0y8H9rQqKkZxwFwAzQK1HXdHPMc8BLu09Iv9wfIV//AeXlpdmciLwIq4IuFewj 5NLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6oBUCv7+phmIrDPpenUTh9zTN/opx5QeamKgnOqn6Ys=; b=ZhHxoqXZ05fWyIj0ol4rhM8lczycP70IQgZytQUzDPEc56JAxNwkYyIHNWhWUtm02G 4tWZ1cNGuL7ymfsmuBY6dT5Gbcc6ZYVrHTdhmgcQf0xJnqqxMNKzacHLkeVhu7EDjrha w39HEzz8RE21kMmH0wKts4vSPKMkMqqi8gaMe0dteX01fL9gjrcLufmQN+p3+Rq3rbKT 4JVWIg1Hi4I/tzBPQKNqxCu4xjSU9Ie6U4p89IKWIaoHJ5RTGvmy5mGisodqp0tjljJN g9t0qYutaCP5sZZ/x8lKSXlbvPuGQemLwl/O3Idhl/jgB9XlLY6Kp1t7JPt4wTM2E5IA EdwQ== X-Gm-Message-State: AGRZ1gKvXQa8IqyI/eOT8wcd6Fbftd8lb9LVnAfZWIDJzEtNKLJCVacr 2U89nqIc5Eiyq8Zeu1jtovxHHMFKNdE= X-Google-Smtp-Source: AJdET5fGUm1Do8xV1K/it+gGfI0WKyFmh/w5GtkJVZTBJmUd33Cf2hYuwcMwY9ltgv5/we6hs3MF0A== X-Received: by 2002:a63:fd09:: with SMTP id d9-v6mr25288789pgh.164.1541532611165; Tue, 06 Nov 2018 11:30:11 -0800 (PST) Received: from localhost.localdomain ([167.220.105.115]) by smtp.gmail.com with ESMTPSA id a18sm9638633pgj.30.2018.11.06.11.30.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 11:30:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 6 Nov 2018 11:30:05 -0800 Message-Id: <20181106193005.5383-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106193005.5383-1-stephen@networkplumber.org> References: <20181106193005.5383-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 4/4] net/tap: fix warning about comparison of fd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 19:30:13 -0000 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 --- 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