patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/nfp: fix file descriptor handle
@ 2019-04-08  9:20 Alejandro Lucero
  2019-04-08 14:24 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Lucero @ 2019-04-08  9:20 UTC (permalink / raw)
  To: dev; +Cc: stable

Although it is rather unlikely getting 0 as the descriptor handle, better
to contemplate that possibility.

Coverity issue: 195018
Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 3e6178c7b..50058e056 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3491,7 +3491,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	fw_f = open(fw_name, O_RDONLY);
-	if (fw_f > 0)
+	if (fw_f >= 0)
 		goto read_fw;
 
 	/* Then try the PCI name */
@@ -3500,7 +3500,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	fw_f = open(fw_name, O_RDONLY);
-	if (fw_f > 0)
+	if (fw_f >= 0)
 		goto read_fw;
 
 	/* Finally try the card type and media */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] net/nfp: fix file descriptor handle
  2019-04-08  9:20 [dpdk-stable] [PATCH] net/nfp: fix file descriptor handle Alejandro Lucero
@ 2019-04-08 14:24 ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-04-08 14:24 UTC (permalink / raw)
  To: Alejandro Lucero, dev; +Cc: stable

On 4/8/2019 10:20 AM, Alejandro Lucero wrote:
> Although it is rather unlikely getting 0 as the descriptor handle, better
> to contemplate that possibility.
> 
> Coverity issue: 195018
> Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH] net/nfp: fix file descriptor handle
@ 2019-04-08  9:14 Alejandro Lucero
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro Lucero @ 2019-04-08  9:14 UTC (permalink / raw)
  To: alucero; +Cc: stable

Although it is rather unlikely getting 0 as the descriptor handle, better
to contemplate that possibility.

Coverity issue: 195018
Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 3e6178c7b..50058e056 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -3491,7 +3491,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	fw_f = open(fw_name, O_RDONLY);
-	if (fw_f > 0)
+	if (fw_f >= 0)
 		goto read_fw;
 
 	/* Then try the PCI name */
@@ -3500,7 +3500,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	fw_f = open(fw_name, O_RDONLY);
-	if (fw_f > 0)
+	if (fw_f >= 0)
 		goto read_fw;
 
 	/* Finally try the card type and media */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-08 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08  9:20 [dpdk-stable] [PATCH] net/nfp: fix file descriptor handle Alejandro Lucero
2019-04-08 14:24 ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2019-04-08  9:14 Alejandro Lucero

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).